Summary: | [dom] Length of VariableDeclarationFragment is not the same inside a 'for' initialisation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | David Audel <david_audel> | ||||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | jerome_lanneluc, Olivier_Thomann | ||||||||
Version: | 3.3 | ||||||||||
Target Milestone: | 3.4 M3 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 199668 | ||||||||||
Attachments: |
|
Description
David Audel
2007-09-17 07:30:44 EDT
Do we want to include the trailing comment inside the positions ? I would say no. The comment could be included in the extended range though. David, any thought ? My explanation wasn't clear. The problem isn't related to trailing comments. The problem is the same without comments. public class X { void foo() { int a , b ; for (int i , j ;;) { } } } Inside a 'for' statement the end of the fragment is at the end of the variable name and inside a locale variable the end is just before the next comma or semicolon. The problem is in the same area as bug 199668. The positions should be consistent in both cases. No whitespaces should be included in the position range. Created attachment 78775 [details]
Proposed fix
Created attachment 78776 [details]
Regression test
Created attachment 78882 [details]
New fix
Released in HEAD. Regression test added in org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#test0686 Verified for 3.4M3 using I20071029-0800 |