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 203892

Summary: [71cat] NullPointerException at com.sun.tools.javac.tree.JCTree$JCClassDecl.getKind
Product: contrib Reporter: dbell
Component: CodeAssignee: issues@contrib <issues>
Status: NEW ---    
Severity: normal CC: ehsavoie, markiewb
Priority: P3    
Version: 7.1   
Hardware: Macintosh   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter: 182087
Attachments: stacktrace
Screenshot of odd code completion suggestions
stacktrace
stacktrace
stacktrace

Description dbell 2011-10-18 11:36:58 UTC
Build: NetBeans IDE Dev (Build 201110140600)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.1-b02-383, Java(TM) SE Runtime Environment, 1.6.0_26-b03-383-11A511
OS: Mac OS X

User Comments:
dbell: Where variable exist: 
CompletionContext context
CompletionModel comptionModel
List<CompletionResultItem> results

And no variable exists: 
substitutionElement

Invoked code completion as indicated by carat:
addNSAwareCompletionItems(|substitutionElement, context, completionModel, results);

Where target method signature is:
private static void addNSAwareCompletionItems(AXIComponent axi, CompletionContextImpl context, CompletionModel cm, List<CompletionResultItem> results)


Code completion suggestions were sane: first giving a list of appropriately-typed variables for the "axi" parameter, then methods with appropriate return types for the "axi" parameter, then a separator, then all other variables/methods in scope. Above all of those suggestions, however, were two suggestions which were not sane:

{ org.netbeans.modules.xml.axi.visitor.AXIVisitor => }
addNSAwareCompletionItems(AXIComponent axi, CompletionContextImpl context, CompletionModel cm, List<CompletionResultItem> results) void




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.tree.JCTree$JCClassDecl.getKind(JCTree.java:598)
   at com.sun.source.util.TreePath.<init>(TreePath.java:89)
   at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:65)
   at org.netbeans.api.java.source.WorkingCopy$2.scan(WorkingCopy.java:421)
   at org.netbeans.api.java.source.WorkingCopy$2.scan(WorkingCopy.java:379)
   at com.sun.source.util.TreeScanner.scanAndReduce(TreeScanner.java:80)
Comment 1 dbell 2011-10-18 11:37:01 UTC
Created attachment 112171 [details]
stacktrace
Comment 2 dbell 2011-10-18 11:39:38 UTC
Created attachment 112172 [details]
Screenshot of odd code completion suggestions
Comment 3 Dusan Balek 2011-10-19 14:19:46 UTC
It seems you have the Extended Java Editor module installed.
Comment 4 markiewb 2015-01-22 12:51:45 UTC
Created attachment 151617 [details]
stacktrace

Code completion for lambda
Comment 5 Exceptions Reporter 2015-01-22 12:51:52 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=182087
Comment 6 ehsavoie 2015-06-02 06:26:00 UTC
Created attachment 154001 [details]
stacktrace

Selecting to fill a stream expression with a lambda
Comment 7 ehsavoie 2015-11-19 07:32:52 UTC
Created attachment 157403 [details]
stacktrace

Trying to introduce lambda as consumer in directorystream.forEach