Bug 44503 - Unoptimal formatting for long constructor argument
Summary: Unoptimal formatting for long constructor argument
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-08 17:33 EDT by Philipe Mulet CLA
Modified: 2003-10-09 18:25 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 Philipe Mulet CLA 2003-10-08 17:33:11 EDT
Build 20031008

Following code once formatted doesn't look super nice:
public class X {
	X(String s) {
	}
	protected void foo() {
		X a = new X(new StringBuffer("this").append("is").append
("a").append(
				"long")
				.append("argument")
				.toString()) {
			public void run() {
			}
		};
	}
}
Comment 1 Philipe Mulet CLA 2003-10-08 17:33:55 EDT
old formatter was behaving somewhat better:

public class X {
	X(String s) {
	}
	protected void foo() {
		X a =
			new X(
				new StringBuffer("this")
					.append("is")
					.append("a")
					.append("long")
					.append("argument")
					.toString()) {
			public void run() {
			}
		};
	}
}
Comment 2 Olivier Thomann CLA 2003-10-08 17:40:34 EDT
This is a known problem. It is a cascading method invocation. We already talked
about it. The only way to fix this is through fragments.
Comment 3 Olivier Thomann CLA 2003-10-09 14:43:22 EDT
Fixed and released.
Regression test added.