Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 108707 - Promote temp to field doesn't preserve formatting
Summary: Promote temp to field doesn't preserve formatting
Status: RESOLVED DUPLICATE of bug 106147
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-02 12:15 EDT by Dirk Baeumer CLA
Modified: 2005-09-02 12:28 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-09-02 12:15:01 EDT
public class A {
	public void foo() {
		@SuppressWarnings("unused") double i= 0, y= 1;
	}
}

promote i to a field. You get:

	public void foo() {
		fI = 0;
		@SuppressWarnings("unused")
		double y= 1;
	}

I expected

	public void foo() {
		fI = 0;
		@SuppressWarnings("unused") double y= 1;
	}
Comment 1 Markus Keller CLA 2005-09-02 12:28:42 EDT
Depends on your code formatter settings. If you like to have annotations on the
same line, you should should turn "New Lines > Insert new line after
Annotations" off and it will work as expected.

However, there's a similar bug 106147 which does not work as expected.
Marking as dup of bug 106147 to check this again once 106147 has been fixed.

*** This bug has been marked as a duplicate of 106147 ***