Bug 135997 - [AST] invalid source range with recovered node
Summary: [AST] invalid source range with recovered node
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-10 16:45 EDT by Martin Aeschlimann CLA
Modified: 2006-04-28 14:03 EDT (History)
2 users (show)

See Also:


Attachments
screenshot ASTview (19.56 KB, image/png)
2006-04-11 04:04 EDT, Martin Aeschlimann CLA
no flags Details
Proposed fix (2.93 KB, patch)
2006-04-18 09:22 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2006-04-10 16:45:36 EDT
20060410

Look at the following code with the (recovered) AST view:

- in the AST View double click the block node of the initializer:
  > its source range does end in the middle of the second statement

Add Olivier as CC as this might be related to the latest addition of incomplete ExpressionStatement

package p1.sub1;

import java.io.File;

public class C2 {
	{
		new Thread();
		File.pathSeparator;
	}
}
Comment 1 Olivier Thomann CLA 2006-04-10 21:08:41 EDT
The latest changes for bug 129330 were not released for the build you are using.
I'll investigate.
Comment 2 Olivier Thomann CLA 2006-04-10 23:11:07 EDT
I tried your test case with 0410 and with HEAD, and I never got wrong positions for the initializer.
Can you reproduce all the time?
Comment 3 Martin Aeschlimann CLA 2006-04-11 03:58:59 EDT
Oh, I used jdt.core HEAD.
Comment 4 Martin Aeschlimann CLA 2006-04-11 04:04:04 EDT
Created attachment 38261 [details]
screenshot ASTview
Comment 5 Olivier Thomann CLA 2006-04-11 10:07:46 EDT
This has nothing to do with the latest changes in the recovered nodes. I can reproduce using 0410 where the changes are not included.

David,

The block doesn't have the same position than the initializer. The initializer's positions are ok, but the block is too short.
Comment 6 David Audel CLA 2006-04-18 09:22:19 EDT
Created attachment 38785 [details]
Proposed fix
Comment 7 David Audel CLA 2006-04-18 09:26:26 EDT
Philippe - Do you want this fix for 3.2RC2 ?
Comment 8 Philipe Mulet CLA 2006-04-18 10:10:28 EDT
+1 for 3.2RC2
Comment 9 David Audel CLA 2006-04-18 10:22:38 EDT
Fix released and test added.
  ASTConverterTestAST3_2#test0645()

Now, position of the block is the same as initializer.
Comment 10 Olivier Thomann CLA 2006-04-28 14:03:56 EDT
Verified with I20060427-1600 for 3.2RC2