Bug 90239 - [formatter] Code Formatter Doesn't Like Long String Assignments
Summary: [formatter] Code Formatter Doesn't Like Long String Assignments
Status: VERIFIED DUPLICATE of bug 71766
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows XP
: P5 normal with 6 votes (vote)
Target Milestone: 4.8 M5   Edit
Assignee: Mateusz Matela CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 131013 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-04 20:17 EDT by David McLeod CLA
Modified: 2018-01-24 00:22 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David McLeod CLA 2005-04-04 20:17:30 EDT
I am using Eclipse 3.0.2

I have the following declaration in an Exception class:

static private final String DEFAULT_MESSAGE = "An unknown problem occurred 
during synchronization.";

The line without formatting is 101 characters long.  I cannot find a setting 
that enables Eclipse to break this statement in a logical way.  Certainly, the 
default values don't work.  Even if I manualy break the statement at the "=" 
sign, subsequent calls to the format revert the line to the original 101 
character length.

Note: For really long strings that are declared this way (i.e. as static 
finals), it would be really nice if I could enable a "string breaking" 
property that would allow the Eclipse formatter to rewrite the whole line as:

static private final String DEFAULT_MESSAGE = "An unknown problem occurred" 
+ " during synchronization.";

This would then allow the formatter to find more logical break points for the 
expression as a whole.
Comment 1 Olivier Thomann CLA 2006-11-21 12:30:34 EST
*** Bug 131013 has been marked as a duplicate of this bug. ***
Comment 2 Frederic Fusier CLA 2008-08-18 08:06:49 EDT
Ownership has changed for the formatter, but 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 3 daniel.hellsson CLA 2011-11-17 09:07:14 EST
Your example seems to be correctly formatted in Indigo Service Release 1, Build ID 20110916-0149.
This bug should probably be closed.
Comment 4 Mateusz Matela CLA 2018-01-20 17:37:30 EST

*** This bug has been marked as a duplicate of bug 71766 ***
Comment 5 Sasikanth Bharadwaj CLA 2018-01-24 00:22:37 EST
Verified for 4.8 M5 using I20180123-2000 build