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.
Build: NetBeans IDE Dev (Build 200807040101) VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02 OS: Linux, 2.6.24-16-generic, i386 User Comments: While editing PHP source code Stacktrace: java.lang.NullPointerException at org.netbeans.modules.php.editor.PHPCodeCompletion.findCompletionContext(PHPCodeCompletion.java:191) at org.netbeans.modules.php.editor.PHPCodeCompletion.complete(PHPCodeCompletion.java:279) at org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.addCodeCompletionItems(GsfCompletionProvider.java:569) at org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.resolveCompletion(GsfCompletionProvider.java:555) at org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.run(GsfCompletionProvider.java:385) at org.netbeans.modules.gsfret.editor.completion.GsfCompletionProvider$JavaCompletionQuery.run(GsfCompletionProvider.java:219)
Created attachment 66376 [details] stacktrace
Weird, looks like a problem with the parser. Apparently for some token token.id() was PHP_CONSTANT_ENCAPSED_STRING and at the same time token.text() was null. Reassigning to ppisl for evaluation The fragment of code was: switch (tokenSequence.token().id()){ case T_INLINE_HTML: return CompletionContext.HTML; case PHP_CONSTANT_ENCAPSED_STRING: if (tokenSequence.token().text().charAt(0) == '"') { // NPE was thrown here!!! return CompletionContext.STRING; } else { return CompletionContext.NONE; } default: }
It would be good to have an reproducible case.
I'm not still able to reproduce it in recent builds. The code completion code has many changes since this issue was filled. I'm closing this as worksforme, please reopen and attach a file, where we can reproduce it.