Bug 71766

Summary: [format] Formatter fails to wrap lines for assignment statements
Product: [Eclipse Project] JDT Reporter: Gopakumar <gopakumarn>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: analogue, ddmcleod, dev, dfayerma, fx, ggregory, Grant.Gardner
Version: 3.0   
Target Milestone: 3.2 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Gopakumar CLA 2004-08-11 07:17:42 EDT
Select 'Java Conventions(built-in)' in code formatter.
Here the max line width is 80.

Try to format the following statement.

public static final AliasLabelType ALLOWANCE_TAB_COMMAND_DELETE = new 
AliasLabelType("ALLOWANCE_TAB_COMMAND_DELETE");

The formatter fails to fit the code in 80 columns. 
This works properly in 2.1.2
Comment 1 Olivier Thomann CLA 2005-06-09 09:59:55 EDT
This is a known problem that will be investigated post 3.1.
Comment 2 Olivier Thomann CLA 2005-08-30 16:53:03 EDT
Created attachment 26654 [details]
Proposed fix

This patch seems to fix this issue. I will do some further testing before
releasing it.
Comment 3 Olivier Thomann CLA 2005-08-31 10:59:40 EDT
Should we use the same option for all assignments (initialization of local
variables and field declarations, assignment, compound assignment)?
I don't think this should apply to assignment inside annotations, because we
might end up with bad line wrapping.
Comment 4 Olivier Thomann CLA 2005-08-31 11:59:29 EDT
*** Bug 87189 has been marked as a duplicate of this bug. ***
Comment 5 Olivier Thomann CLA 2005-08-31 12:07:33 EDT
Right now I share the same option. I called it:
FORMATTER_ALIGNMENT_FOR_ASSIGNMENT

This will be available only at the code level for now.
It needs to be added in the code formatter preference page.
See bug 108478.

Fixed and released in HEAD.
Regression tests in
org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test593/596.
Comment 6 Olivier Thomann CLA 2005-08-31 12:12:10 EDT
*** Bug 93433 has been marked as a duplicate of this bug. ***
Comment 7 David Audel CLA 2005-09-20 12:45:23 EDT
Verified in I20050920-0010 for 3.2M2
Comment 8 Olivier Thomann CLA 2005-10-19 15:13:06 EDT
*** Bug 63631 has been marked as a duplicate of this bug. ***
Comment 9 Olivier Thomann CLA 2006-01-25 09:56:45 EST
*** Bug 124792 has been marked as a duplicate of this bug. ***
Comment 10 Mateusz Matela CLA 2018-01-20 17:37:30 EST
*** Bug 90239 has been marked as a duplicate of this bug. ***