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 269848

Summary: NullPointerException at com.sun.tools.javac.util.Log$DeferredDiagnosticHandler.reportDeferredDiagnostics
Product: java Reporter: muellermi <muellermi>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: normal CC: muellermi, ozziej, tboudreau
Priority: P1    
Version: Dev   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 228074
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
stacktrace

Description muellermi 2017-02-16 12:51:39 UTC
Build: NetBeans IDE Dev (Build 201702150002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.112-b15, Java(TM) SE Runtime Environment, 1.8.0_112-b15
OS: Windows 7

User Comments:
muellermi: switching file in editor




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.util.Log$DeferredDiagnosticHandler.reportDeferredDiagnostics(Log.java:169)
   at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.showDiagnostics(JavacProcessingEnvironment.java:1259)
   at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1322)
   at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1345)
   at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1233)
   at com.sun.tools.javac.main.JavaCompiler.lambda$readSourceFile$126(JavaCompiler.java:934)
Comment 1 muellermi 2017-02-16 12:51:42 UTC
Created attachment 163649 [details]
stacktrace
Comment 2 muellermi 2017-02-17 13:39:24 UTC
Created attachment 163652 [details]
stacktrace

external change
Comment 3 muellermi 2017-02-21 15:12:25 UTC
Created attachment 163680 [details]
stacktrace

opened editor
Comment 4 ozziej 2017-03-02 09:12:31 UTC
Created attachment 163745 [details]
stacktrace

Exception occurred while generating entity classes from database
Comment 5 Exceptions Reporter 2017-03-07 04:18:32 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=228074
Comment 6 muellermi 2017-03-20 09:25:24 UTC
problem occurs nearly every time I switch via ctrl+b to a non-opened source file. If the source is open, or had been opened within the same NB session before, it seems to work without exception.
Comment 7 muellermi 2017-03-20 09:42:45 UTC
The same problem occurs in different situations. 
Reproducible, if I try to invoke autocompletion for a self defind annotation, which is not imported to the current file yet.
Comment 8 muellermi 2017-04-10 08:22:28 UTC
really annoying. Every week I try the latest dev build and stop using after a short while :(
Comment 9 muellermi 2017-05-02 09:56:55 UTC
I don't like to stop evaluating the daily build everytime because of this annoying bug. Increased priority to 1. Please fix soon!
Comment 10 muellermi 2017-05-02 11:14:07 UTC
This bug might be OS dependent:
At home I'm using Linux. I can't remember that I faced this problem there. But I really code less than in office.
Comment 11 Dusan Balek 2017-05-03 11:11:40 UTC
Unfortunately, I cannot reproduce the problem. Is it reproducible on your sources? If so, could you please create a simple test project with the exact steps to reproduce and attach it to the issue? Thanks.
Comment 12 _ tboudreau 2017-05-28 09:04:52 UTC
Created attachment 164420 [details]
stacktrace

Trying to refactor an interface method's return type from String to CharSequence with many projects open that both call and implement the method
Comment 13 _ tboudreau 2017-05-28 20:29:30 UTC
Possible way to reproduce:

1.  First, clone this repo and run its init script (it pulls in a bunch of git submodules that contain maven subprojects - it will run a build that will eventually fail unless you have mongodb installed, but it will do enough - make sure you work against the commit specified below, before this refactoring was done):

git clone https://github.com/timboudreau/mastfrog-parent.git
git checkout 87409dcd1682b8bc63b929ad24d5cc7a5c869dfe

2.  Now, open the root project in NetBeans; expand the Modules node fully, select all of them, right click and open all subprojects;  wait for NetBeans to finish scanning.

3.  In the project Acteur Headers (acteur-modules/acteur-parent/acteur-headers), refactor HeaderValueType.name() to return CharSequence instead of String.

You should get the exception when the preview dialog comes up.


Side-note: after this and then doing the refactoring manually, compile-on-save makes an absolute mess of things, generating classes which see HeaderValueType as an erroneous type and substituting Object for it where it is passed.
Comment 14 Dusan Balek 2017-06-09 08:45:10 UTC
I've tried the steps described in the Comment 13 - but everything worked as expected. Tim, could you please try to run your scenario with the latest dev build? Thanks.
Comment 15 muellermi 2017-07-05 12:40:54 UTC
With the current build (20170705) it seems to be ok. I could not reproduce it the way I could before.
I haven't checke thoudreau's steps to reproduce.
Comment 16 Dusan Balek 2017-09-01 12:20:06 UTC
Should be fixed in the current dev build.