Bug 287701

Summary: [dom] Length of Assignment should not include whitespace
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.6   
Target Milestone: 3.6 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 271639    
Attachments:
Description Flags
Proposed fix + regression test none

Description Markus Keller CLA 2009-08-26 10:50:13 EDT
I20090825-1032

The length of an Assignment ASTNode should not include whitespace or comments after the RightHandSide node.

For VariableDeclarationFragments, the same problem has already been fixed with bug 203579.

public class Snippet {
	void m() {
		int x= 1      ;
		int y= - 1  , z=0   ;
		// Assignment nodes too long:
		int a= x = 2      ;
		System.out.print(    x=1     );
		java.util.Arrays.asList(    x=1    /*bla*/  , x= 2
			// comment	
		);
	}
}
Comment 1 Olivier Thomann CLA 2009-08-26 13:02:22 EDT
Right, comments should be part of the extended source range.
Comment 2 Olivier Thomann CLA 2009-08-26 18:54:56 EDT
Created attachment 145732 [details]
Proposed fix + regression test
Comment 3 Olivier Thomann CLA 2009-08-26 18:55:42 EDT
Released for 3.6M2.
Regression test added in:
org.eclipse.jdt.core.tests.dom.ASTConverter15Test#test0337
Comment 4 Kent Johnson CLA 2009-09-15 11:42:44 EDT
Verified for 3.6M2