Summary: | [formatting] Prevent line breaks before "." | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Scott Duchin <sduchin> |
Component: | Core | Assignee: | Mateusz Matela <mateusz.matela> |
Status: | VERIFIED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | frederic_fusier, mateusz.matela, Olivier_Thomann, ric.almeida |
Version: | 3.1 | ||
Target Milestone: | 4.7 M2 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=59891 https://bugs.eclipse.org/bugs/show_bug.cgi?id=95735 |
||
Whiteboard: | To be verified for 4.7 M2 |
Description
Scott Duchin
2005-05-31 13:46:17 EDT
There is another problem with line breaking before dots. The following example shows it best (see end of comment for code to reproduce the bug): Code before formatting: private int testvar = someObject.someMethod(args); Code after formatting: private int testvar = someObject .someMethod(args); Code before formatting: someObject.someMethod("This is a long non breakable String constant"); Code after formatting: someObject .someMethod("This is a long non breakable String constant"); This happens with long non-breakable code lines (for example String constants) and especially with setting the format option "Align fields in columns". The line breaks should be prevented. For easy reproduction insert the folling code into your class declaration and set "Align fields in columns" to enabled. Format the code fragment. The formatter will indent the code after 's' in the last line in a wrong way. private static final AppConfigurationEntry.LoginModuleControlFlag CONSTANTWITHLONGNAME = null; private String s = ""; private String testString = s.concat("This is a long non-breakable String constant that won't be broken"); *** This bug has been marked as a duplicate of 59891 *** This issue will be considered separately from bug 59891. These issues no longer occur after the formatter redesign. Wrapping on assignment operator is now naturally considered higher priority than inside the assigned expression. Note that wrapping on assignment is not enabled by default though. *** This bug has been marked as a duplicate of bug 303519 *** Verified for 4.7 M2 using I20160912-2000 build |