diff options
| author | Mateusz Matela | 2018-12-29 22:33:46 +0000 |
|---|---|---|
| committer | Mateusz Matela | 2018-12-31 19:10:55 +0000 |
| commit | 493b1db1a86ea21508e52ce0e66697f6588135ef (patch) | |
| tree | efb9b78cd4d6127458a96b0e3dd9c21f29da4c82 | |
| parent | 8cecb52045ea032de3aee0f6fdcddfe6ecb63d11 (diff) | |
| download | eclipse.jdt.ui-493b1db1a86ea21508e52ce0e66697f6588135ef.tar.gz eclipse.jdt.ui-493b1db1a86ea21508e52ce0e66697f6588135ef.tar.xz eclipse.jdt.ui-493b1db1a86ea21508e52ce0e66697f6588135ef.zip | |
Bug 543080 - [formatter] wrapping binary expressions: separate optionsI20190106-1800I20190106-0600I20190106-0150I20190105-1800I20190105-0810I20190104-1800I20190103-1800I20190102-1800I20190101-1800I20181231-1800
for operator types - UI
Change-Id: Id4ca224beb5123111a2a42312c99c39314edaed7
Signed-off-by: Mateusz Matela <mateusz.matela@gmail.com>
6 files changed, 134 insertions, 35 deletions
diff --git a/org.eclipse.jdt.ui/preview/formatter.java b/org.eclipse.jdt.ui/preview/formatter.java index 6d460ffd11..f15d82e89c 100644 --- a/org.eclipse.jdt.ui/preview/formatter.java +++ b/org.eclipse.jdt.ui/preview/formatter.java @@ -838,25 +838,42 @@ class Example {SomeClass foo() {return SomeOtherClass.new SomeClass(100, 500 );}} //--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression -//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_binary_expression -class Example extends AnotherClass {int foo() { int sum= 100 - + 200 - + 300 - + 400 - + 500 - + 600 - + 700 - + 800; int product= 1 - * 2 - * 3 - * 4 - * 5 - * 6 - * 7 - * 8 - * 9 - * 10; boolean val= true && false && true && false && true; return product / sum;}} -//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_binary_expression +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_additive_operator +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_string_concatenation +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_shift_operator +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_relational_operator +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator +//--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_logical_operator +class Example { + +boolean firstIsGreater = 11111111 + 22222222 + +33333333 + 44444444 + +55555555 + 66666666 +> +1.11111111 * 2.22222222 * 3.33333333 +* 4.44444444 * 5.55555555 * 6.66666666; + +String concatenatedString = "one two three four " + "five six seven eight " + "nine ten eleven twelve"; + +int shiftedInteger = 0xCAFEFACE >>> 0x00000001 + >>> + 0x00000002 + << + 0x00000003 >>> 0x00000004; + +int bitAritmetic = 0xCAFEFACE | 0x01010101 & 0x02020202 ^ 0x03030303 ^ 0x04040404 | 0x05050505; + +boolean multipleConditions = conditionOne && conditionTwo || conditionThree && conditionFour || conditionFive; + +} +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_additive_operator +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_string_concatenation +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_shift_operator +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_relational_operator +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator +//--PREVIEW--END--org.eclipse.jdt.core.formatter.alignment_for_logical_operator //--PREVIEW--START--org.eclipse.jdt.core.formatter.alignment_for_conditional_expression class Example extends AnotherClass {int foo(boolean argument) {return argument ? 100000 : 200000;}} diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java index 2a7a1990b9..64122cfb93 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.java @@ -120,11 +120,12 @@ final class FormatterMessages extends NLS { public static String FormatterModifyDialog_indentation_tree_indentation; public static String FormatterModifyDialog_indentation_tree_indented_elements; public static String FormatterModifyDialog_lineWrap_indentation_policy_label; + public static String FormatterModifyDialog_lineWrap_pref_additive_operators; public static String FormatterModifyDialog_lineWrap_pref_annotations_arguments; public static String FormatterModifyDialog_lineWrap_pref_arguments; public static String FormatterModifyDialog_lineWrap_pref_array_init; public static String FormatterModifyDialog_lineWrap_pref_assignments; - public static String FormatterModifyDialog_lineWrap_pref_binary_exprs; + public static String FormatterModifyDialog_lineWrap_pref_bitwise_operators; public static String FormatterModifyDialog_lineWrap_pref_catch; public static String FormatterModifyDialog_lineWrap_pref_compact_if_else; public static String FormatterModifyDialog_lineWrap_pref_compact_loops; @@ -138,8 +139,10 @@ final class FormatterMessages extends NLS { public static String FormatterModifyDialog_lineWrap_pref_extends_clause; public static String FormatterModifyDialog_lineWrap_pref_for; public static String FormatterModifyDialog_lineWrap_pref_implements_clause; + public static String FormatterModifyDialog_lineWrap_pref_logical_operators; public static String FormatterModifyDialog_lineWrap_pref_max_line_width; public static String FormatterModifyDialog_lineWrap_pref_module_statements; + public static String FormatterModifyDialog_lineWrap_pref_multiplicative_operators; public static String FormatterModifyDialog_lineWrap_pref_never_join_lines; public static String FormatterModifyDialog_lineWrap_pref_object_allocation_arguments; public static String FormatterModifyDialog_lineWrap_pref_param_type_arguments; @@ -148,11 +151,15 @@ final class FormatterMessages extends NLS { public static String FormatterModifyDialog_lineWrap_pref_parameters; public static String FormatterModifyDialog_lineWrap_pref_qualified_invocations; public static String FormatterModifyDialog_lineWrap_pref_qualified_object_allocation_arguments; + public static String FormatterModifyDialog_lineWrap_pref_relational_operators; + public static String FormatterModifyDialog_lineWrap_pref_shift_operators; + public static String FormatterModifyDialog_lineWrap_pref_string_concatenation; public static String FormatterModifyDialog_lineWrap_pref_superinterfaces; public static String FormatterModifyDialog_lineWrap_pref_throws_clause; public static String FormatterModifyDialog_lineWrap_pref_try; public static String FormatterModifyDialog_lineWrap_pref_wrap_outer_expressions_when_nested; public static String FormatterModifyDialog_lineWrap_tree_annotations; + public static String FormatterModifyDialog_lineWrap_tree_binary_expressions; public static String FormatterModifyDialog_lineWrap_tree_class_decls; public static String FormatterModifyDialog_lineWrap_tree_constructor_decls; public static String FormatterModifyDialog_lineWrap_tree_enum_decls; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties index 61e15b4e5b..3b8a63bf2a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterMessages.properties @@ -189,6 +189,7 @@ FormatterModifyDialog_lineWrap_pref_constant_arguments=Constant arguments FormatterModifyDialog_lineWrap_pref_constants=Constants FormatterModifyDialog_lineWrap_pref_implements_clause='implements' clause FormatterModifyDialog_lineWrap_pref_parameters=Parameters +FormatterModifyDialog_lineWrap_pref_additive_operators=Additive operators (+, -) FormatterModifyDialog_lineWrap_pref_arguments=Arguments FormatterModifyDialog_lineWrap_pref_qualified_invocations=Qualified invocations FormatterModifyDialog_lineWrap_pref_for='for' @@ -199,7 +200,6 @@ FormatterModifyDialog_lineWrap_pref_qualified_object_allocation_arguments=Qualif FormatterModifyDialog_lineWrap_pref_array_init=Array initializers FormatterModifyDialog_lineWrap_pref_explicit_constructor_invocations=Explicit constructor invocations FormatterModifyDialog_lineWrap_pref_conditionals=Conditionals -FormatterModifyDialog_lineWrap_pref_binary_exprs=Binary expressions FormatterModifyDialog_lineWrap_pref_module_statements=Module statements FormatterModifyDialog_lineWrap_val_indentation_default=Default indentation FormatterModifyDialog_lineWrap_val_indentation_on_column=Indent on column @@ -209,7 +209,7 @@ FormatterModifyDialog_lineWrap_tree_class_decls=Class Declarations FormatterModifyDialog_lineWrap_tree_method_decls=Method Declarations FormatterModifyDialog_lineWrap_tree_constructor_decls=Constructor declarations FormatterModifyDialog_lineWrap_tree_function_calls=Function Calls -FormatterModifyDialog_lineWrap_tree_expressions=Expressions +FormatterModifyDialog_lineWrap_tree_expressions=Other expressions FormatterModifyDialog_lineWrap_tree_statements=Statements FormatterModifyDialog_lineWrap_tree_parameterized_types=Parameterized types FormatterModifyDialog_lineWrap_tree_enum_decls='enum' declaration @@ -226,17 +226,24 @@ FormatterModifyDialog_lineWrap_val_wrap_always_except_first_only_if_necessary=Wr FormatterModifyDialog_lineWrap_val_wrap_after_operators=Wrap after operators FormatterModifyDialog_lineWrap_val_wrap_before_operators=Wrap before operators FormatterModifyDialog_lineWrap_pref_max_line_width=Maximum line width: +FormatterModifyDialog_lineWrap_pref_multiplicative_operators=Multiplicative operators (*, /, %) FormatterModifyDialog_lineWrap_pref_default_indent_wrapped=Default indentation for wrapped lines: FormatterModifyDialog_lineWrap_pref_default_indent_array=Default indentation for array initializers: FormatterModifyDialog_lineWrap_pref_never_join_lines=Never join already wrapped lines +FormatterModifyDialog_lineWrap_pref_shift_operators=Shift operators (<<, >>, >>>) +FormatterModifyDialog_lineWrap_pref_string_concatenation=String concatenation FormatterModifyDialog_lineWrap_pref_superinterfaces='implements' clause FormatterModifyDialog_lineWrap_pref_assignments=Assignments FormatterModifyDialog_lineWrap_tree_annotations=Annotations +FormatterModifyDialog_lineWrap_tree_binary_expressions=Binary expressions FormatterModifyDialog_lineWrap_pref_annotations_arguments=Element-value pairs +FormatterModifyDialog_lineWrap_pref_bitwise_operators=Bitwise operators (&&, ^, |) +FormatterModifyDialog_lineWrap_pref_logical_operators=Logical operators (&&&&, ||) FormatterModifyDialog_lineWrap_pref_wrap_outer_expressions_when_nested=Prefer wrapping outer expressions (keep nested expression on one line) FormatterModifyDialog_lineWrap_pref_param_type_ref=Type references FormatterModifyDialog_lineWrap_pref_param_type_arguments=Type arguments FormatterModifyDialog_lineWrap_pref_param_type_parameters=Type parameters +FormatterModifyDialog_lineWrap_pref_relational_operators=Relational operators (<, >, <=, >=, ==, \!=) FormatterModifyDialog_blankLines_tree_compilation_unit=Blank lines in compilation unit FormatterModifyDialog_blankLines_pref_before_package=Before package declaration: diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterModifyDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterModifyDialog.java index 84850eb6a1..baf0a46069 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterModifyDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/FormatterModifyDialog.java @@ -1245,11 +1245,18 @@ public class FormatterModifyDialog extends ModifyDialog { .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_explicit_constructor_invocations, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL) .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_object_allocation_arguments, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION) .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_qualified_object_allocation_arguments, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION)) + .node(fTree.builder(FormatterMessages.FormatterModifyDialog_lineWrap_tree_binary_expressions, "-binary-expressions", modAll) //$NON-NLS-1$ + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_multiplicative_operators, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_additive_operators, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_string_concatenation, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_shift_operators, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SHIFT_OPERATOR) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_relational_operators, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RELATIONAL_OPERATOR) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_bitwise_operators, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BITWISE_OPERATOR) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_logical_operators, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_LOGICAL_OPERATOR)) .node(fTree.builder(FormatterMessages.FormatterModifyDialog_lineWrap_tree_expressions, null, modAll) - .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_binary_exprs, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION) .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_conditionals, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION) - .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_array_init, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER) - .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_assignments, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT)) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_assignments, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ASSIGNMENT) + .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_array_init, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER)) .node(fTree.builder(FormatterMessages.FormatterModifyDialog_lineWrap_tree_statements, null, modAll) .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_for, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_FOR_LOOP_HEADER) .pref(FormatterMessages.FormatterModifyDialog_lineWrap_pref_compact_if_else, DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_COMPACT_IF) @@ -1268,8 +1275,26 @@ public class FormatterModifyDialog extends ModifyDialog { case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION: wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_CONDITIONAL_OPERATOR; break; - case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION: - wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BINARY_OPERATOR; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_MULTIPLICATIVE_OPERATOR; + break; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_ADDITIVE_OPERATOR; + break; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_STRING_CONCATENATION; + break; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_SHIFT_OPERATOR: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_SHIFT_OPERATOR; + break; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_RELATIONAL_OPERATOR: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_RELATIONAL_OPERATOR; + break; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BITWISE_OPERATOR: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BITWISE_OPERATOR; + break; + case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_LOGICAL_OPERATOR: + wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_LOGICAL_OPERATOR; break; case DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH: wrapBeforeKey= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileVersioner.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileVersioner.java index a089b1d4ce..4c5df9bb46 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileVersioner.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileVersioner.java @@ -43,10 +43,10 @@ public class ProfileVersioner implements IProfileVersioner { private static final int VERSION_12= 12; // https://bugs.eclipse.org/318010 private static final int VERSION_13= 13; // https://bugs.eclipse.org/514019 private static final int VERSION_14= 14; // https://bugs.eclipse.org/128653, https://bugs.eclipse.org/531826 - private static final int VERSION_15= 15; // https://bugs.eclipse.org/205973 + private static final int VERSION_16= 16; // https://bugs.eclipse.org/543080 - private static final int CURRENT_VERSION= VERSION_15; + private static final int CURRENT_VERSION= VERSION_16; @Override public int getFirstVersion() { @@ -111,9 +111,12 @@ public class ProfileVersioner implements IProfileVersioner { case VERSION_13 : version13to14(oldSettings); //$FALL-THROUGH$ - case VERSION_14: - version14to15(oldSettings); - //$FALL-THROUGH$ + case VERSION_14: + version14to15(oldSettings); + //$FALL-THROUGH$ + case VERSION_15: + version15to16(oldSettings); + //$FALL-THROUGH$ default: for (final Iterator<String> iter= oldSettings.keySet().iterator(); iter.hasNext(); ) { final String key= iter.next(); @@ -462,7 +465,7 @@ public class ProfileVersioner implements IProfileVersioner { checkAndReplace(oldSettings, FORMATTER_BINARY_EXPRESSION_ALIGNMENT, - DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION); + FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION); checkAndReplace(oldSettings, FORMATTER_COMPACT_IF_ALIGNMENT, @@ -657,6 +660,23 @@ public class ProfileVersioner implements IProfileVersioner { } } + private static void version15to16(Map<String, String> oldSettings) { + checkAndReplace(oldSettings, FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION, new String[] { + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR, + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR, + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION, + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BITWISE_OPERATOR, + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_LOGICAL_OPERATOR, + }); + checkAndReplace(oldSettings, FORMATTER_WRAP_BEFORE_BINARY_OPERATOR, new String[] { + DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_MULTIPLICATIVE_OPERATOR, + DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_ADDITIVE_OPERATOR, + DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_STRING_CONCATENATION, + DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BITWISE_OPERATOR, + DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_LOGICAL_OPERATOR, + }); + } + /* old format constant values */ private static final String FORMATTER_METHOD_DECLARATION_ARGUMENTS_ALIGNMENT = JavaCore.PLUGIN_ID + ".formatter.method_declaration_arguments_alignment"; //$NON-NLS-1$ @@ -848,4 +868,27 @@ public class ProfileVersioner implements IProfileVersioner { */ @Deprecated private static final String FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION= DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION; + + /** + * @deprecated As of 3.17 replaced by + * {@link DefaultCodeFormatterConstants#FORMATTER_ALIGNMENT_FOR_MULTIPLICATIVE_OPERATOR}, + * {@link DefaultCodeFormatterConstants#FORMATTER_ALIGNMENT_FOR_ADDITIVE_OPERATOR}, + * {@link DefaultCodeFormatterConstants#FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION}, + * {@link DefaultCodeFormatterConstants#FORMATTER_ALIGNMENT_FOR_BITWISE_OPERATOR}, + * and + * {@link DefaultCodeFormatterConstants#FORMATTER_ALIGNMENT_FOR_LOGICAL_OPERATOR} + */ + @Deprecated + private static final String FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION= DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION; + + /** + * @deprecated As of 3.17 replaced by + * {@link DefaultCodeFormatterConstants#FORMATTER_WRAP_BEFORE_MULTIPLICATIVE_OPERATOR}, + * {@link DefaultCodeFormatterConstants#FORMATTER_WRAP_BEFORE_ADDITIVE_OPERATOR}, + * {@link DefaultCodeFormatterConstants#FORMATTER_WRAP_BEFORE_STRING_CONCATENATION}, + * {@link DefaultCodeFormatterConstants#FORMATTER_WRAP_BEFORE_BITWISE_OPERATOR}, and + * {@link DefaultCodeFormatterConstants#FORMATTER_WRAP_BEFORE_LOGICAL_OPERATOR} + */ + @Deprecated + private static final String FORMATTER_WRAP_BEFORE_BINARY_OPERATOR= DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BINARY_OPERATOR; } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java index 4ed166f924..9753729380 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaStringAutoIndentStrategy.java @@ -228,7 +228,7 @@ public class JavaStringAutoIndentStrategy extends DefaultIndentLineAutoEditStrat private boolean isWrappingBeforeBinaryOperator() { return DefaultCodeFormatterConstants.TRUE.equals(getCoreFormatterOption( - DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_BINARY_OPERATOR)); + DefaultCodeFormatterConstants.FORMATTER_WRAP_BEFORE_STRING_CONCATENATION)); } private int getContinuationIndentationSize() { @@ -244,7 +244,7 @@ public class JavaStringAutoIndentStrategy extends DefaultIndentLineAutoEditStrat private int getBinaryOperatorAlignmentStyle() { String binaryAlignmentValue= getCoreFormatterOption( - DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION); + DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_STRING_CONCATENATION); return DefaultCodeFormatterConstants.getIndentStyle(binaryAlignmentValue); } |
