| Summary: | Code formatter does not wrap some long lines | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lauri Pekonen <larza> |
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, daniel.hellsson, mateusz.matela, Olivier_Thomann, remy.suen |
| Version: | 3.6.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Please open bugs with the Java tooling with the JDT team. I think this is the intended behaviour. Please check the line wrapping options you have under Preferences>Java>Code style>Formatter> Line wrapping and for "Function calls>Qualified invocations" category, check the "Force split even if line shorter than maximum width" option. The call gets wrapped only if this option is checked, not otherwise. Olivier, please correct me if i'm wrong. Sorry, I don't understand. That solution will also wrap the shorter lines, which is not the desired behaviour. Shouldn't "Wrap where necessary" just split the lines where they are longer than line width and leave others alone? I have this problem in jdt_root 3.7.1 (Indigo Service Release 1), Build ID 20110916-0149.
With my example, line length set to 80 and "Wrap all arguments, each argument on a new line" and "Indent by one", the line is not indented!
Example code:
public class Foo
{
private String this_is_the_alert_error_message = "Alert!";
private String this_is_the_error_error_message = "Error!";
public void testMethod()
{
final String messageInternalFailure =
this_is_the_alert_error_message.concat( this_is_the_error_error_message );
System.out.println( messageInternalFailure );
}
}
This problem no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 *** |
Build Identifier: M20110210-1200 Code formatter does not wrap some long lines, can't pinpoint what causes it. Reproducible: Always Steps to Reproduce: 1. Set formatter line width to 120, indent 4 spaces only 2. Paste in the following code: package test; public class FormatterTest { void test() { if (true) { asdf.do1234567890123456(asdf.do12345678901234567890123456789012345().getTable().getSelectedRows().length == 1); } } static class asdf { static void do1234567890123456(boolean b) { } public static Foo do12345678901234567890123456789012345() { return null; } } static class Foo { public Bar getTable() { return null; } } static class Bar { public Object[] getSelectedRows() { return null; } } } 3. The longest line here is 124 chars. On my Eclipse this line does not wrap. Wonder if this is reproducible. On 3.5 this works?