Bug 248246

Summary: [dom] Save participant fails when 'new' keyword is used twice
Product: [Eclipse Project] JDT Reporter: Remy Suen <remy.suen>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, jerome_lanneluc, Mike_Wilson, Olivier_Thomann, srikanth_sankaran
Version: 3.5   
Target Milestone: 3.6 M1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
The log file of my workspace. none

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