Bug 248246 - [dom] Save participant fails when 'new' keyword is used twice
Summary: [dom] Save participant fails when 'new' keyword is used twice
Status: VERIFIED DUPLICATE of bug 274898
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-23 05:45 EDT by Remy Suen CLA
Modified: 2009-08-04 08:15 EDT (History)
5 users (show)

See Also:


Attachments
The log file of my workspace. (29.66 KB, text/plain)
2008-09-23 05:45 EDT, Remy Suen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2008-09-23 05:45:12 EDT
Created attachment 113232 [details]
The log file of my workspace.

I20080918-0100

Test file:

public class Test {

	private void v() {
		Object o = new new Object() {};
	}
}

----------------

1. Copy / paste the file into a new project and save. This should work
2. Window > Preferences > Java > Editor > Save Actions
3. Check 'Perform the selected actions on save'. The defaults should be fine. Click 'OK'.
4. Make the file dirty and save again.
5. An error occurs.
Comment 1 Olivier Thomann CLA 2008-09-29 09:34:04 EDT
Added regression tests in:
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#_test0697
org.eclipse.jdt.core.tests.dom.ASTConverterTestAST3_2#_test0698

David,

The problem seems to come from the statement recovery.
I wrote two test cases:
1) I expect the method body to be empty since there is no statement recovery. We do get one statement.
2) I expect the statement to be recovered and the source range to cover the statement properly. Right now the declaration source end doesn't seem to be set.

Both tests are disabled for now.
Comment 2 Mike Wilson CLA 2009-05-05 10:55:45 EDT
Changing Version tag to something more believable.
Comment 3 David Audel CLA 2009-06-25 05:25:50 EDT
I enabled and updated tests test0697 and test0698.
1) The body contains one statement: the anonymous type
2) The statement recovery works but does not recover the full AST (bug 277805).


*** This bug has been marked as a duplicate of bug 274898 ***
Comment 4 Jay Arthanareeswaran CLA 2009-08-04 01:28:14 EDT
Verified for 3.6M1 using I20090802-2000