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 242717

Summary: NullPointerException at com.sun.tools.javac.comp.Attr$TypeAnnotationsValidator.visitNewClass
Product: java Reporter: frederic.gendebien
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: adv, KevinAnderson, RichardTingle
Priority: P2    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 206745
Attachments: stacktrace
dump file

Description frederic.gendebien 2014-03-09 16:55:19 UTC
Build: NetBeans IDE 8.0 Beta (Build 201401141042)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b69, Java(TM) SE Runtime Environment, 1.8.0-b127
OS: Mac OS X

User Comments:
GUEST: Filling in constructor args.

frederic.gendebien: I was creating an anonymous class of type Comparator and when I used completion to generate the body I received a NPE

GUEST: Was finding and replacing TreeSet with ArrayList. Error just popped up then. I can't see a major issue though.

GUEST: delete some java class, and open the java file which need dependent the deleted classes, error reported




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.comp.Attr$TypeAnnotationsValidator.visitNewClass(Attr.java:4667)
   at com.sun.tools.javac.tree.JCTree$JCNewClass.accept(JCTree.java:1516)
   at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49)
   at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57)
   at com.sun.tools.javac.tree.TreeScanner.visitNewClass(TreeScanner.java:207)
   at com.sun.tools.javac.comp.Attr$TypeAnnotationsValidator.visitNewClass(Attr.java:4672)
Comment 1 frederic.gendebien 2014-03-09 16:55:22 UTC
Created attachment 145883 [details]
stacktrace
Comment 2 Exceptions Reporter 2014-08-21 16:04:54 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=206745
Comment 3 Exceptions Reporter 2014-12-12 08:52:36 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=206745
Comment 4 Dusan Balek 2015-02-09 09:44:55 UTC
Fixed in jet-main.

http://hg.netbeans.org/main/nb-javac/rev/4d2222373842
Comment 5 clinuxrulz 2015-07-19 23:22:50 UTC
Created attachment 154715 [details]
dump file

The code uses T_, T__, ... to simulate high order generics. That seems to be crashing netbeans parser, even though javac compiles it fine.