This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181588 - [69cat] Exception on Template or AutoComplete Use
Summary: [69cat] Exception on Template or AutoComplete Use
Status: VERIFIED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-05 09:11 UTC by laurin1
Modified: 2010-03-12 09:07 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 165945


Attachments
stacktrace (7.29 KB, text/plain)
2010-03-05 09:11 UTC, laurin1
Details
Test project that generates this exception (26.75 KB, application/x-zip-compressed)
2010-03-10 09:24 UTC, laurin1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description laurin1 2010-03-05 09:11:48 UTC
Build: NetBeans IDE Dev (Build 201003031246)
VM: Java HotSpot(TM) Client VM, 14.3-b01, Java(TM) SE Runtime Environment, 1.6.0_17-b04
OS: Windows 7

User Comments:
alganet: Issue related to the ":?" short ternary operator. If I remove the PHP lines in which they appear, the error stops.
Updated just now and the error is still present




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.php.editor.indent.WSTransformer.visit(WSTransformer.java:753)
   at org.netbeans.modules.php.editor.parser.astnodes.ConditionalExpression.accept(ConditionalExpression.java:94)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor.scan(DefaultVisitor.java:51)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultVisitor.visit(DefaultVisitor.java:79)
   at org.netbeans.modules.php.editor.parser.astnodes.visitors.DefaultTreePathVisitor.visit(DefaultTreePathVisitor.java:174)
   at org.netbeans.modules.php.editor.parser.astnodes.Assignment.accept(Assignment.java:109)
Comment 1 laurin1 2010-03-05 09:11:52 UTC
Created attachment 94805 [details]
stacktrace
Comment 2 laurin1 2010-03-09 17:11:25 UTC
Mine is caused by PHP templates. When I hit tab to expand one, this is the exception I get.
Comment 3 laurin1 2010-03-09 17:23:19 UTC
Actually, now it's happening on expanding just about anything.
Comment 4 laurin1 2010-03-10 07:51:38 UTC
Raising to P1, as now the product is unusable.
Comment 5 Jiri Kovalsky 2010-03-10 08:19:44 UTC
Petre, can you please fix this? This bug is a showstopper for one NetCAT 6.9
participant and avoids him to continue. Thanks a lot!
Comment 6 Filip Zamboj 2010-03-10 08:31:59 UTC
Product Version: NetBeans IDE Dev (Build 100310-9ff6c4eb76b6)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

@laurin: I can't reproduce. could you give me some example or a file where it happens? I don't have any exception when expanding templates and don't have it even if I use ternary operator as you mentioned in exception report. 


This is not P1 but P2. Easy workaround for a while: don't use template but type the code till this is fixed. thanks a lot.
Comment 7 laurin1 2010-03-10 08:59:37 UTC
The ternary comment is not mine. This happens for Templates AND AutoComplete. That makes it unusable. I can't complete functions or methods without getting this error.
Comment 8 laurin1 2010-03-10 09:24:38 UTC
Created attachment 94995 [details]
Test project that generates this exception

I moved this file to a new project and it still generates the exception. Do this:

* type self:: and then control-space, select ProgressTrackingUI() and hit enter. Does it every time for me. 
* Does it on ec and then control-space, selecting echo. same exception.
Comment 9 laurin1 2010-03-10 09:25:17 UTC
I've added a test file and instructions in the Details of how to get the Exception every single time, at least on my machine.
Comment 10 Petr Pisl 2010-03-10 10:23:31 UTC
It's caused with a conditional expression without the true value like:
$sPhase = substr($sPhaseTeam, 1, 1) ?: ''

Fixed in the trunk. Thanks for the reproducible case. It was very helpful and easy to fix.

Fixed in the webmain 
changeset:   163069:cfe17d9e0214
Comment 11 laurin1 2010-03-11 16:03:09 UTC
Ok, I just tried it in the latest Hudson build and is not working.

Here is my template:

$oTable				= new Table();
$oTable->sTableStyle	= "";
$oTable->sTableClass	= "";
$oTable->iBorder		= ;
$oTable->iCellPadding	= ;
$oTable->iCellSpacing	= ;
$oTable->Cell();

here is the result from typing table and pressing tab:

$oTable = new Table();
$oTable->sTableStyle = "";
$oTable->sTableClass = "";
$oTable->iBorder = ;
$oTable->iCellPadding = ;
$oTable->iCellSpacing = ;
$oTable->Cell();
Comment 12 Filip Zamboj 2010-03-12 03:49:22 UTC
(In reply to comment #11)
> Ok, I just tried it in the latest Hudson build and is not working.

well, but do you get exception? Otherwise I think you want to add this comment to bug 181644. 

> 
> Here is my template:
> 
> $oTable                = new Table();
> $oTable->sTableStyle    = "";
> $oTable->sTableClass    = "";
> $oTable->iBorder        = ;
> $oTable->iCellPadding    = ;
> $oTable->iCellSpacing    = ;
> $oTable->Cell();
> 
> here is the result from typing table and pressing tab:
> 
> $oTable = new Table();
> $oTable->sTableStyle = "";
> $oTable->sTableClass = "";
> $oTable->iBorder = ;
> $oTable->iCellPadding = ;
> $oTable->iCellSpacing = ;
> $oTable->Cell();
Comment 13 Quality Engineering 2010-03-12 04:23:13 UTC
Integrated into 'main-golden', will be available in build *201003120200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/cfe17d9e0214
User: Petr Pisl <ppisl@netbeans.org>
Log: #181588 -  [69cat] Exception on Template or AutoComplete Use
Comment 14 laurin1 2010-03-12 08:56:53 UTC
Sorry, yes, that comment was meant for 181644. Something keeps happening so that when I press Commit on this page, it changes to a different bug ID after it submits and I don't always realize that has happened. Why is bugzilla doing that?
Comment 15 Jiri Kovalsky 2010-03-12 09:01:42 UTC
I don't know what's causing this but our Bugzilla is surely not in a good condition these days. Very slow or timing out connections very often. :-(
Comment 16 Filip Zamboj 2010-03-12 09:07:55 UTC
(In reply to comment #14)
> Sorry, yes, that comment was meant for 181644. Something keeps happening so
> that when I press Commit on this page, it changes to a different bug ID after
> it submits and I don't always realize that has happened. Why is bugzilla doing
> that?

because it goes to the next by default. you can change you preferences in bugzilla on the top of the page under find button




so if you can't reproduce this exception I consider this as verified. thanks.