Summary: | Quick Fix "Assign parameter to new field" doesn't appear with commented type | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | martinae | ||||||
Version: | 3.1 | ||||||||
Target Milestone: | 3.2 RC2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Markus Keller
2004-12-14 03:26:47 EST
reproduced in 20050509-2010 The reason is that the AST received from reconcile has the second parameter 'Integer integer' represented as a SingleVariableDeclaration with source range starting at the block comment start, overlapping with the first parameter. Unfortunatly the ASTView doesn't show you this. We thought the 'reconciled' mode in the ASTView would do the same as happens in reconcile, but obviously there is a third case of AST are build. Set a breakpoint in QuickAssistProcessor.getAssignParamToFieldProposals to see that node. If you can't reproduce and the quick assist show up correcty: Cut the constructor, save, wait a bit, paste and do the quick fix When I put a breakpoint in QuickAssistProcessor.getAssignParamToFieldProposals, the 'node' param is a SingleVariableDeclaration for 'Integer integer'. When I inspect its parent and look at the first parameter, the position of the SingleVariableDeclation 'List list' is correct. So why is the 'node' the SingleVariableDeclaration 'Integer integer' ? The problem is the source range of the SingleVariableDeclaration for 'Integer integer'. I just reproduced this again in N20060418-0010 Thanks for the clarification. The problem comes from the fact that we don't use the same parser when the working copy is consistent (CommentRecorderParser), and when it is not (SourceElementParser). SourceElementParser#checkComment() was not updated when CommentRecorderParser#checkComment() was. Created attachment 38954 [details]
Proposed patch and regression test
+1 for 3.2RC2 Patch is not good. It prevents non-Javadoc comments from being associated with a declaration. Created attachment 39071 [details]
Better patch and same regression test
Verified with I20060427-1600 for RC2. |