Summary: | [content assist] RuntimeException thrown by JavaTypeCompletionProposalComputer | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Gunnar Wagenknecht <gunnar> | ||||||
Component: | Core | Assignee: | David Audel <david_audel> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | daniel_megert, jerome_lanneluc | ||||||
Version: | 3.4 | ||||||||
Target Milestone: | 3.5 M2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows Vista | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Gunnar Wagenknecht
2008-08-04 02:38:24 EDT
Unfortunately, this happens occasionally. I didn't find a way to reproduce it. I tried a fresh workspace but it didn't work. The type in question had compile errors, though. It was similar to this one: --- package test; import java.util.Dictionary; public abstract class Test { private final String id; protected Test(final String id) { if (null == [INVOKED_CODE_COMPLETE_HERE]) { this.id = id; } } public abstract Object newInstance(String id, Dictionary<String, String> properties); public boolean validateId(final String repositoryId) { return true; } } --- However, I couldn't reproduce it useing the code above in a fresh workspace. Created attachment 109042 [details]
Test project for reproducing
Ok, I think I found a test case. Import the attached test project and open Test.java. Follow the instructions in the comment inside the constructor
Simpler test case: public class Test { public void foo() { if (null== //<-- code assist before comment } } This bug got introduced in 3.4. Might be a 3.4.1 candidate. org.eclipse.jdt.core.CompletionContext.getExpectedTypesSignatures() returns [[N]]. This seems wrong. In 3.3.2 JDT Core returned: [[S], [I], [J], [F], [D], [C], [B]] Created attachment 111667 [details]
Proposed fix
Released for 3.5M2. Test added CompletionContextTests#test0166() getExpectedTypesSignatures() will return no expected type in this case. Verified for 3.5M2 using I20080914-2000 |