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 8.1 (Build 201510222201) VM: Java HotSpot(TM) 64-Bit Server VM, 25.144-b01, Java(TM) SE Runtime Environment, 1.8.0_144-b01 OS: Linux User Comments: GUEST: Please review this problem scanti: Editing a .java file mpetras: Probable steps I did before I got the exception: 1) I create a nested enum class. 2) In one of the outer class' methods, I changed the argument type from 'int' to the just-created enum 3) Started replacing the int values with the enum values in a switch-statement. The value being compared by the switch-statement was taken from the respective argument. So I started replacing int constants in the switch-statement with enum values from the nested enum class. I think I got the exception at the moment I tried to use code-completion for completing the enum value in the case-statement. Stacktrace: java.lang.NullPointerException at com.sun.source.util.TreePath.<init>(TreePath.java:97) at org.netbeans.modules.java.completion.JavaCompletionTask.addEnumConstants(JavaCompletionTask.java:3356) at org.netbeans.modules.java.completion.JavaCompletionTask.insideCase(JavaCompletionTask.java:2069) at org.netbeans.modules.java.completion.JavaCompletionTask.resolve(JavaCompletionTask.java:370) at org.netbeans.modules.java.completion.BaseTask.run(BaseTask.java:92) at org.netbeans.modules.java.completion.JavaCompletionTask.run(JavaCompletionTask.java:80)
Created attachment 164934 [details] stacktrace
Additional information: The declaration of the nested enum class contained no modifiers (such as "public" or "static"). So the classes looked like this: public class OuterClass { enum NestedEnum { FIRST_VALUE(1), SECOND_VALUE(2), THIRD_VALUE(3), ... EIGHTH_VALUE(10), ; private final int id; private NestedEnum(final int id) { this.id = id; } } ... public static String perform(..., TaskList what, ...) { ... switch (what) { default: log.warn("..."); //fall-through case FIRS<<caret>> ... break; case ... ... ... } ... } ... }
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/f62f94befb0b
Integrated into 'main-silver', will be available in build *201708200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f62f94befb0b User: Dusan Balek <dbalek@netbeans.org> Log: Issue #271275 - NullPointerException at com.sun.source.util.TreePath.<init> - fixed.