Community
Participate
Working Groups
I had about this much in the editor: public team class TeamClass { enum Aufzaehlung { EINS, ZWEI; } prote } Then pressing Ctrl-space after "prote" caused this NPE: java.lang.NullPointerException at org.eclipse.jdt.internal.codeassist.CompletionEngine.findOverridableRoles(CompletionEngine.java:10727) at org.eclipse.jdt.internal.codeassist.CompletionEngine.completionOnFieldType(CompletionEngine.java:2284) at org.eclipse.jdt.internal.codeassist.CompletionEngine._OT$complete$orig(CompletionEngine.java:1701) at org.eclipse.jdt.internal.codeassist.CompletionEngine._OT$complete$chain(CompletionEngine.java) at org.eclipse.jdt.internal.codeassist.CompletionEngine._OT$complete$chain(CompletionEngine.java) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1967)
Issue seems to be related to the enum rather than the incomplete keyword, after manually completing the role class invoking completion after "main" again triggered the same NPE.
Created attachment 202267 [details] test & fix Fixed by a simple null-check, documenting why this can happen (enum).
Patch has been released for 2.1 M2 (r1980/81).
Verified using build 2.2.1.201209182002