Bug 287701 - [dom] Length of Assignment should not include whitespace
Summary: [dom] Length of Assignment should not include whitespace
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 271639
  Show dependency tree
 
Reported: 2009-08-26 10:50 EDT by Markus Keller CLA
Modified: 2009-09-15 11:42 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix + regression test (6.60 KB, patch)
2009-08-26 18:54 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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