| Summary: | [assist] NPE during completion if team contains an enum | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTDT | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 2.0 | ||||||
| Target Milestone: | 2.1 M2 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
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 |
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)