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 227851 - NullPointerException at com.sun.tools.javac.comp.Check.checkClassOverrideEqualsAndHash
Summary: NullPointerException at com.sun.tools.javac.comp.Check.checkClassOverrideEqua...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-23 15:18 UTC by rudyment
Modified: 2017-07-23 10:39 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 199830


Attachments
stacktrace (2.40 KB, text/plain)
2013-03-23 15:18 UTC, rudyment
Details
stacktrace (2.96 KB, text/plain)
2013-03-25 14:30 UTC, misterm
Details
stacktrace (2.96 KB, text/plain)
2013-03-25 14:36 UTC, misterm
Details
stacktrace (2.96 KB, text/plain)
2013-03-25 17:09 UTC, Jesse Glick
Details
stacktrace (3.69 KB, text/plain)
2013-03-25 19:30 UTC, Jesse Glick
Details
stacktrace (2.95 KB, text/plain)
2013-03-26 11:57 UTC, dynamite
Details
stacktrace (7.44 KB, text/plain)
2013-03-27 15:27 UTC, misterm
Details
stacktrace (2.96 KB, text/plain)
2013-03-27 16:56 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rudyment 2013-03-23 15:18:53 UTC
Build: NetBeans IDE Dev (Build jdk8lambda-1690-on-20130322)
VM: OpenJDK 64-Bit Server VM, 25.0-b21, OpenJDK Runtime Environment, 1.8.0-ea-lambda-nightly-h3728-20130318-b82-b00
OS: Windows 7

User Comments:
rudyment: Exception occurred after opening the IDE while parsing opened projects




Stacktrace: 
java.lang.NullPointerException
   at com.sun.tools.javac.comp.Check.checkClassOverrideEqualsAndHash(Check.java:2053)
   at com.sun.tools.javac.comp.Check.checkClassOverrideEqualsAndHashIfNeeded(Check.java:2043)
   at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4145)
   at com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4074)
   at com.sun.tools.javac.comp.Attr.visitClassDef(Attr.java:880)
   at org.netbeans.lib.nbjavac.services.NBAttr.visitClassDef(NBAttr.java:70)
Comment 1 rudyment 2013-03-23 15:18:56 UTC
Created attachment 132978 [details]
stacktrace
Comment 2 misterm 2013-03-25 14:30:42 UTC
Created attachment 133036 [details]
stacktrace

Opened a source file
Comment 3 Exceptions Reporter 2013-03-25 14:30:47 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=199830
Comment 4 misterm 2013-03-25 14:36:42 UTC
Created attachment 133038 [details]
stacktrace

.
Comment 5 Exceptions Reporter 2013-03-25 14:36:47 UTC
This bug already has 10 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=199830
Comment 6 Jan Lahoda 2013-03-25 14:58:29 UTC
To reproduce, enable Tools/Options/Editor/Hints/Java/Standard Javac Warnings/Override, and use this code:
-----
public class Override extends F {
    
}
-----
Comment 7 Jesse Glick 2013-03-25 17:09:43 UTC
Created attachment 133048 [details]
stacktrace

Opened CronTabTest from Jenkins sources. Had bogus error messages in it (should have found generated sources); and this exception was thrown.
Comment 8 Jesse Glick 2013-03-25 19:30:43 UTC
Created attachment 133055 [details]
stacktrace

Opened a Maven project.
Comment 9 dynamite 2013-03-26 11:57:43 UTC
Created attachment 133079 [details]
stacktrace

Havebn't touched the editor for 10 secs or so and got this.  I have recently upgraded from 7.3 to 201303232300 with imported settings and have only 3 files open.
Comment 10 Jesse Glick 2013-03-26 17:12:25 UTC
This is thrown constantly in the current dev builds; should be considered P2.
Comment 11 misterm 2013-03-27 15:27:43 UTC
Created attachment 133143 [details]
stacktrace

Typing
Comment 12 Exceptions Reporter 2013-03-27 15:27:50 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=199830
Comment 13 Jesse Glick 2013-03-27 16:56:42 UTC
Created attachment 133150 [details]
stacktrace

Nothing special.
Comment 14 Jesse Glick 2013-03-28 17:38:18 UTC
Tempted to mark this P1 since it renders the IDE close to useless.
Comment 16 fommil 2017-07-23 10:39:43 UTC
Interestingly we've been seeing the same issue (or very similar) in ENSIME https://github.com/ensime/ensime-server/pull/1764

which can be reproduced by trying to typecheck these snippets (remove our @ syntax for cursor location) in any OpenJDK8 (Windows and OSX seem to throw StackOverflow rather than NullPointerException)

        | import java.lang.Boolean;
        | import javafx.application.Application;
        | import javafx.beans.value.ObservableValue;
        | import javafx.scene.Scene;
        | import javafx.scene.control.CheckBox;
        | import javafx.scene.layout.VBox;
        | import javafx.stage.Stage;
        |
        | public class JavaFxAddListenerTest extends Application {
        |     @Override
        |     public void start(Stage primaryStage) {
        |         VBox root = new VBox();
        |         CheckBox cb = new CheckBox();
        |         cb.selectedProperty().addListener((ObservableValue<? extends Bool@0@> ov, Boolean oldValue, Boolean newValue) -> {});
        |         Scene scene = new Scene(root);
        |         primaryStage.setScene(scene);
        |         primaryStage.show();
        |     }
        |
        |     public static void main(String[] args) {
        |         launch(args);
        |     }
        | }

a related issue (doesn't throw in Windows and OSX is)


        | import java.lang.Boolean;
        | import javafx.application.Application;
        | import javafx.beans.value.ObservableValue;
        | import javafx.scene.Scene;
        | import javafx.scene.control.CheckBox;
        | import javafx.scene.layout.VBox;
        | import javafx.stage.Stage;
        |
        | public class JavaFxAddListenerTest extends Application {
        |     @Override
        |     public void start(Stage primaryStage) {
        |         VBox root = new VBox();
        |         CheckBox cb = new CheckBox();
        |         ObservableValue<? extends Bool@0@>
        |         Scene scene = new Scene(root);
        |         primaryStage.setScene(scene);
        |         primaryStage.show();
        |     }
        |
        |     public static void main(String[] args) {
        |         launch(args);
        |     }
        | }


I noticed that the fix is in http://hg.netbeans.org/main/nb-javac/rev/2b9b60de0c69 which appears to be the SUN javac API.

But this fix hasn't made it back to the OpenJDK mainline, for some years. Will that eventually happen?

I don't think we want to start using the Netbeans tools.jar but if we did, where is it published?