Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 250636 - [formatter] wraps on assignment unnecessarily
Summary: [formatter] wraps on assignment unnecessarily
Status: CLOSED DUPLICATE of bug 109381
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P5 normal with 1 vote (vote)
Target Milestone: 4.5   Edit
Assignee: Mateusz Matela CLA
QA Contact:
URL:
Whiteboard: To be verified for 4.15 M1
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-13 07:48 EDT by John Ferguson CLA
Modified: 2020-01-11 16:49 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Ferguson CLA 2008-10-13 07:48:32 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. In the Java code formatter:
 a) Set "Maximum line width" to 40
 b) Set Assignments to "Wrap only when necessary"
 c) Set Binary expressions to "Wrap only when necessary"
2. Write the following Java code
public class WrapTest {
    String string = "helloworld" + "helloworldhello";
}
3. Format the code. Now looks like this:
public class WrapTest {
    String string =
            "helloworld"
                    + "helloworldhello";
}
...when it "should" look like this (1 less wrap):
public class WrapTest {
    String string = "helloworld"
            + "helloworldhello";
}

Note: setting Assignments to "Do not wrap" is not an option for me, since they must wrap when they really do need to. For example, if you have the following (with max line width at 40):
public class WrapTest {
    String string = "helloworldhelloworld";
}
...which after wrapping becomes:
public class WrapTest {
    String string =
            "helloworldhelloworld";
}

More information:
Comment 1 Frederic Fusier CLA 2008-10-14 10:00:56 EDT
Not 100% sure but it looks like a duplicate of bug 109381...

Unfortunately, I surely will not have enough time to fix your bug during the
3.5 development process, hence set its priority to P5.
Please provide a patch if you definitely need the bug to be fixed in this
version and I'll have a look at it...
TIA
Comment 2 Eclipse Genie CLA 2020-01-07 16:59:27 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 3 Mateusz Matela CLA 2020-01-11 16:49:44 EST
This was indeed a duplicate, the problem no longer occurs.

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