View | Details | Raw Unified | Return to bug 282030 | Differences between
and this patch

Collapse All | Expand All

(-)buildnotes_jdt-core.html (-1 / +1 lines)
Lines 59-65 Link Here
59
 * FORMATTER / Option for alignment of arguments in annotation
59
 * FORMATTER / Option for alignment of arguments in annotation
60
 *     - option id:         "org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
60
 *     - option id:         "org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
61
 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
61
 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
62
 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
62
 *     - default:           createAlignmentValue(false, WRAP_NO_SPLIT, INDENT_DEFAULT)
63
 * 
63
 * 
64
 * @see #createAlignmentValue(boolean, int, int)
64
 * @see #createAlignmentValue(boolean, int, int)
65
 * @since 3.6
65
 * @since 3.6
(-)formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java (-1 / +1 lines)
Lines 90-96 Link Here
90
	 * FORMATTER / Option for alignment of arguments in annotation
90
	 * FORMATTER / Option for alignment of arguments in annotation
91
	 *     - option id:         "org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
91
	 *     - option id:         "org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
92
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
92
	 *     - possible values:   values returned by <code>createAlignmentValue(boolean, int, int)</code> call
93
	 *     - default:           createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)
93
	 *     - default:           createAlignmentValue(false, WRAP_NO_SPLIT, INDENT_DEFAULT)
94
	 * </pre>
94
	 * </pre>
95
	 * @see #createAlignmentValue(boolean, int, int)
95
	 * @see #createAlignmentValue(boolean, int, int)
96
	 * @since 3.6
96
	 * @since 3.6
(-)formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java (-4 / +4 lines)
Lines 627-635 Link Here
627
			try {
627
			try {
628
				this.alignment_for_arguments_in_annotation = Integer.parseInt((String) alignmentForArgumentsInAnnotationOption);
628
				this.alignment_for_arguments_in_annotation = Integer.parseInt((String) alignmentForArgumentsInAnnotationOption);
629
			} catch (NumberFormatException e) {
629
			} catch (NumberFormatException e) {
630
				this.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
630
				this.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
631
			} catch (ClassCastException e) {
631
			} catch (ClassCastException e) {
632
				this.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
632
				this.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
633
			}
633
			}
634
		}
634
		}
635
		final Object alignmentForArgumentsInEnumConstantOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT);
635
		final Object alignmentForArgumentsInEnumConstantOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT);
Lines 1980-1986 Link Here
1980
1980
1981
	public void setDefaultSettings() {
1981
	public void setDefaultSettings() {
1982
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
1982
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
1983
		this.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
1983
		this.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
1984
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
1984
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
1985
		this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
1985
		this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
1986
		this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
1986
		this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
Lines 2247-2253 Link Here
2247
2247
2248
	public void setJavaConventionsSettings() {
2248
	public void setJavaConventionsSettings() {
2249
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
2249
		this.alignment_for_arguments_in_allocation_expression = Alignment.M_COMPACT_SPLIT;
2250
		this.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
2250
		this.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
2251
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
2251
		this.alignment_for_arguments_in_enum_constant = Alignment.M_COMPACT_SPLIT;
2252
		this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
2252
		this.alignment_for_arguments_in_explicit_constructor_call = Alignment.M_COMPACT_SPLIT;
2253
		this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
2253
		this.alignment_for_arguments_in_method_invocation = Alignment.M_COMPACT_SPLIT;
(-)src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java (-1 / +1 lines)
Lines 768-773 Link Here
768
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=282030"
768
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=282030"
769
 */
769
 */
770
public void testBug282030() throws JavaModelException {
770
public void testBug282030() throws JavaModelException {
771
	this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
771
	String source =
772
	String source =
772
		"@DeclareParents(value =\n" + 
773
		"@DeclareParents(value =\n" + 
773
		"\"com.apress.springrecipes.calculator.ArithmeticCalculatorImpl\", defaultImpl =\n" + 
774
		"\"com.apress.springrecipes.calculator.ArithmeticCalculatorImpl\", defaultImpl =\n" + 
Lines 783-789 Link Here
783
	);
784
	);
784
}
785
}
785
public void testBug282030a() throws JavaModelException {
786
public void testBug282030a() throws JavaModelException {
786
	this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
787
	String source =
787
	String source =
788
		"@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" + 
788
		"@MyAnnot(value1 = \"this is an example\", value2 = \"of an annotation\", value3 = \"with several arguments\", value4 = \"which may need to be wrapped\")\n" + 
789
		"public class Test {\n" + 
789
		"public class Test {\n" + 
(-)src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java (-1 / +1 lines)
Lines 7298-7304 Link Here
7298
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7298
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7299
		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7299
		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7300
        preferences.tab_size = 4;
7300
        preferences.tab_size = 4;
7301
		preferences.alignment_for_arguments_in_annotation = Alignment.M_NO_ALIGNMENT;
7302
		Hashtable javaCoreOptions = JavaCore.getOptions();
7301
		Hashtable javaCoreOptions = JavaCore.getOptions();
7303
		try {
7302
		try {
7304
			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7303
			Hashtable newJavaCoreOptions = JavaCore.getOptions();
Lines 7322-7327 Link Here
7322
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7321
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
7323
		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7322
		preferences.tab_char = DefaultCodeFormatterOptions.TAB;
7324
        preferences.tab_size = 4;
7323
        preferences.tab_size = 4;
7324
		preferences.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT;
7325
		Hashtable javaCoreOptions = JavaCore.getOptions();
7325
		Hashtable javaCoreOptions = JavaCore.getOptions();
7326
		try {
7326
		try {
7327
			Hashtable newJavaCoreOptions = JavaCore.getOptions();
7327
			Hashtable newJavaCoreOptions = JavaCore.getOptions();

Return to bug 282030