Summary: | [content assist] override method proposal in anonymous class inserts bad stub | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | daniel_megert, jarthana, Olivier_Thomann, remy.suen | ||||
Version: | 3.7 | ||||||
Target Milestone: | 3.7 M4 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Markus Keller
2010-11-11 09:33:04 EST
This looks like a bug in JDT Core's NodeFinder: in the first case it returns the ExpressionStatement but in the second/correct one, it correctly returns the AnonymousClassDeclaration node. Also, if I remove "hash", do code assist and then select 'hashCode', it also works fine. The problem comes from the positions (start/length) of the assignment node are wrong. They don't include the anonymous type declaration. This is easily visible using the ASTView and double-clicking on the assignment node. Only "field= new Object()" is selected. This is related to the syntax error recovery. Positions are fine if the code doesn't contain syntax errors. Investigating. Created attachment 183147 [details]
Proposed fix + regression test
Released for 3.7M4. Verified for 3.7M4 using build I20101206-1800 |