Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355255 - [assist] NPE during completion if team contains an enum
Summary: [assist] NPE during completion if team contains an enum
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 2.0   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-19 14:58 EDT by Stephan Herrmann CLA
Modified: 2012-09-20 17:05 EDT (History)
0 users

See Also:


Attachments
test & fix (3.10 KB, patch)
2011-08-27 10:05 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-08-19 14:58:58 EDT
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)
Comment 1 Stephan Herrmann CLA 2011-08-19 15:18:19 EDT
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.
Comment 2 Stephan Herrmann CLA 2011-08-27 10:05:19 EDT
Created attachment 202267 [details]
test & fix

Fixed by a simple null-check, documenting why this can happen (enum).
Comment 3 Stephan Herrmann CLA 2011-08-27 10:07:20 EDT
Patch has been released for 2.1 M2 (r1980/81).
Comment 4 Stephan Herrmann CLA 2012-09-20 17:05:10 EDT
Verified using build 2.2.1.201209182002