Bug 257907

Summary: [Formatter] FORMATTER_PRESERVE_EXISTING_LINE_BREAKS needs clarification
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: jerome_lanneluc
Version: 3.5   
Target Milestone: 3.5 M4   
Hardware: All   
OS: All   
Whiteboard:

Description Dani Megert CLA 2008-12-08 06:31:25 EST
I20081202-1812.

The FORMATTER_PRESERVE_EXISTING_LINE_BREAKS option says:

Option to specify whether the formatter should preserve existing line breaks or not

This is too generic. It should tell more precisely what it does i.e. in which cases it applies.
Comment 1 Frederic Fusier CLA 2008-12-08 06:58:30 EST
I think this one should go into 3.5M4 as well, otherwise we would need to deprecate it if we decided to change the name (as I'm intending to do....)
Comment 2 Frederic Fusier CLA 2008-12-08 07:03:54 EST
So, instead of the too generic one, here's the new constant proposal:
/**
 * <pre>
 * FORMATTER / Option to specify whether the formatter should preserve existing wrapping line breaks or not
 * 
 * 		For example, the wrapped lines of method foo return statement in following test case:
 * 			class X {
 * 			String foo() {
 * 			return "select x "
 * 			       + "from y "
 * 			       + "where z=a";
 * 			}
 * 			}
 *
 * 		will be preserved by the formatter when the new preference is used,
 * 		hence produces the following output:
 * 			class X {
 * 			    String foo() {
 * 			        return "select x "
 * 			                + "from y "
 * 			                + "where z=a";
 * 			    }
 * 			}
 *
 *     - option id:         "org.eclipse.jdt.core.formatter.preserve_existing_wrapping_line_breaks"
 *     - possible values:   { TRUE, FALSE }
 *     - default:           FALSE
 * </pre>
 * @since 3.5
 */
public static final String FORMATTER_PRESERVE_EXISTING_WRAPPING_LINE_BREAKS = JavaCore.PLUGIN_ID + ".formatter.preserve_existing_wrapping_line_breaks";	//$NON-NLS-1$
Comment 3 Jerome Lanneluc CLA 2008-12-08 07:49:21 EST
I think the name should be consistent with what's proposed in bug 257906.
So what about "FORMATTER_JOIN_WRAPPED_LINES" with a default set to TRUE ?
Comment 4 Frederic Fusier CLA 2008-12-08 11:13:07 EST
Patch of bug 257906 was released for 3.5M4 in HEAD stream which fixes this bug as well.
Comment 5 Kent Johnson CLA 2008-12-09 13:43:28 EST
Verified for 3.5M4 using I20081209-0100