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

Collapse All | Expand All

(-)formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java (+87 lines)
Lines 1288-1298 Link Here
1288
	 * @see JavaCore#INSERT
1288
	 * @see JavaCore#INSERT
1289
	 * @see JavaCore#DO_NOT_INSERT
1289
	 * @see JavaCore#DO_NOT_INSERT
1290
	 * @since 3.4
1290
	 * @since 3.4
1291
	 * @deprecated
1292
	 * All new options must be enabled to activate old strategy
1293
	 * {@link #FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD}
1294
	 * {@link #FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD}
1295
	 * {@link #FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE}
1296
	 * {@link #FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE}
1291
	 */
1297
	 */
1292
	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_annotation_on_member";//$NON-NLS-1$
1298
	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_annotation_on_member";//$NON-NLS-1$
1293
1299
1294
	/**
1300
	/**
1295
	 * <pre>
1301
	 * <pre>
1302
	 * FORMATTER / Option to insert a new line after an annotation on a field declaration
1303
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field"
1304
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1305
	 *     - default:           INSERT
1306
	 * </pre>
1307
	 * @see JavaCore#INSERT
1308
	 * @see JavaCore#DO_NOT_INSERT
1309
	 * @since 3.7
1310
	 */
1311
	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_annotation_on_field";//$NON-NLS-1$
1312
1313
	/**
1314
	 * <pre>
1315
	 * FORMATTER / Option to insert a new line after an annotation on a method declaration
1316
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method"
1317
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1318
	 *     - default:           INSERT
1319
	 * </pre>
1320
	 * @see JavaCore#INSERT
1321
	 * @see JavaCore#DO_NOT_INSERT
1322
	 * @since 3.7
1323
	 */
1324
	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_annotation_on_method";//$NON-NLS-1$
1325
1326
	/**
1327
	 * <pre>
1328
	 * FORMATTER / Option to insert a new line after an annotation on a package declaration
1329
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package"
1330
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1331
	 *     - default:           INSERT
1332
	 * </pre>
1333
	 * @see JavaCore#INSERT
1334
	 * @see JavaCore#DO_NOT_INSERT
1335
	 * @since 3.7
1336
	 */
1337
	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_annotation_on_package";//$NON-NLS-1$
1338
1339
	/**
1340
	 * <pre>
1341
	 * FORMATTER / Option to insert a new line after an annotation on a type declaration
1342
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type"
1343
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1344
	 *     - default:           INSERT
1345
	 * </pre>
1346
	 * @see JavaCore#INSERT
1347
	 * @see JavaCore#DO_NOT_INSERT
1348
	 * @since 3.7
1349
	 */
1350
	public static final String FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE = JavaCore.PLUGIN_ID + ".formatter.insert_new_line_after_annotation_on_type";//$NON-NLS-1$
1351
1352
	/**
1353
	 * <pre>
1296
	 * FORMATTER / Option to insert a new line after an annotation on a parameter
1354
	 * FORMATTER / Option to insert a new line after an annotation on a parameter
1297
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
1355
	 *     - option id:         "org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
1298
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
1356
	 *     - possible values:   { INSERT, DO_NOT_INSERT }
Lines 3849-3854 Link Here
3849
	}
3907
	}
3850
3908
3851
	/**
3909
	/**
3910
	 * Return an array of compatible constants for an obsolete constant.
3911
	 * 
3912
	 * @param name The name of the obsolete constant
3913
	 * @return The list as a non-empty array of the compatible constants or
3914
	 * <code>null</code> if the constant is <b>not</b> obsolete.
3915
	 */
3916
	public static String[] getCompatibleConstants(String name) {
3917
		if (FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER.equals(name)) {
3918
			return new String[] {
3919
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD,
3920
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD,
3921
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE,
3922
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE
3923
			};
3924
		}
3925
		if (FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION.equals(name)) {
3926
			return new String[] {
3927
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD,
3928
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD,
3929
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE,
3930
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE,
3931
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE,
3932
				FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER
3933
			};
3934
		}
3935
		return null;
3936
	}
3937
3938
	/**
3852
	 * <p>Return the indentation style of the given alignment value.
3939
	 * <p>Return the indentation style of the given alignment value.
3853
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
3940
	 * The given alignment value should be created using the <code>createAlignmentValue(boolean, int, int)</code>
3854
	 * API.
3941
	 * API.
(-)formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java (-8 / +8 lines)
Lines 561-567 Link Here
561
		Alignment memberAlignment = this.scribe.getMemberAlignment();
561
		Alignment memberAlignment = this.scribe.getMemberAlignment();
562
562
563
        this.scribe.printComment();
563
        this.scribe.printComment();
564
		this.scribe.printModifiers(fieldDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
564
		this.scribe.printModifiers(fieldDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_FIELD);
565
		this.scribe.space();
565
		this.scribe.space();
566
		/*
566
		/*
567
		 * Field type
567
		 * Field type
Lines 675-681 Link Here
675
		Alignment fieldAlignment = this.scribe.getMemberAlignment();
675
		Alignment fieldAlignment = this.scribe.getMemberAlignment();
676
676
677
        this.scribe.printComment();
677
        this.scribe.printComment();
678
		this.scribe.printModifiers(multiFieldDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
678
		this.scribe.printModifiers(multiFieldDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_FIELD);
679
		this.scribe.space();
679
		this.scribe.space();
680
680
681
		multiFieldDeclaration.declarations[0].type.traverse(this, scope);
681
		multiFieldDeclaration.declarations[0].type.traverse(this, scope);
Lines 911-917 Link Here
911
		this.scribe.printComment();
911
		this.scribe.printComment();
912
		int line = this.scribe.line;
912
		int line = this.scribe.line;
913
913
914
		this.scribe.printModifiers(typeDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
914
		this.scribe.printModifiers(typeDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_TYPE);
915
915
916
		if (this.scribe.line > line) {
916
		if (this.scribe.line > line) {
917
			// annotations introduced new line, but this is not a line wrapping
917
			// annotations introduced new line, but this is not a line wrapping
Lines 2443-2449 Link Here
2443
         * Print comments to get proper line number
2443
         * Print comments to get proper line number
2444
         */
2444
         */
2445
        this.scribe.printComment();
2445
        this.scribe.printComment();
2446
        this.scribe.printModifiers(annotationTypeMemberDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
2446
        this.scribe.printModifiers(annotationTypeMemberDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
2447
		this.scribe.space();
2447
		this.scribe.space();
2448
		/*
2448
		/*
2449
		 * Print the method return type
2449
		 * Print the method return type
Lines 3070-3076 Link Here
3070
				this.scribe.printEmptyLines(blankLinesBeforePackage);
3070
				this.scribe.printEmptyLines(blankLinesBeforePackage);
3071
			}
3071
			}
3072
3072
3073
			this.scribe.printModifiers(currentPackage.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
3073
			this.scribe.printModifiers(currentPackage.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_PACKAGE);
3074
			this.scribe.space();
3074
			this.scribe.space();
3075
			// dump the package keyword
3075
			// dump the package keyword
3076
			this.scribe.printNextToken(TerminalTokens.TokenNamepackage);
3076
			this.scribe.printNextToken(TerminalTokens.TokenNamepackage);
Lines 3306-3312 Link Here
3306
         */
3306
         */
3307
        this.scribe.printComment();
3307
        this.scribe.printComment();
3308
        int line = this.scribe.line;
3308
        int line = this.scribe.line;
3309
		this.scribe.printModifiers(constructorDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
3309
		this.scribe.printModifiers(constructorDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
3310
		if (this.scribe.line > line) {
3310
		if (this.scribe.line > line) {
3311
        	// annotations introduced new line, but this is not a line wrapping
3311
        	// annotations introduced new line, but this is not a line wrapping
3312
			// see 158267
3312
			// see 158267
Lines 3523-3529 Link Here
3523
         */
3523
         */
3524
        this.scribe.printComment();
3524
        this.scribe.printComment();
3525
        final int line = this.scribe.line;
3525
        final int line = this.scribe.line;
3526
        this.scribe.printModifiers(enumConstant.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
3526
        this.scribe.printModifiers(enumConstant.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_FIELD);
3527
		this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
3527
		this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier, false);
3528
		formatEnumConstantArguments(
3528
		formatEnumConstantArguments(
3529
			enumConstant,
3529
			enumConstant,
Lines 4219-4225 Link Here
4219
		do {
4219
		do {
4220
			try {
4220
			try {
4221
4221
4222
				this.scribe.printModifiers(methodDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_MEMBER);
4222
				this.scribe.printModifiers(methodDeclaration.annotations, this, ICodeFormatterConstants.ANNOTATION_ON_METHOD);
4223
				int fragmentIndex = 0;
4223
				int fragmentIndex = 0;
4224
				this.scribe.alignFragment(methodDeclAlignment, fragmentIndex);
4224
				this.scribe.alignFragment(methodDeclAlignment, fragmentIndex);
4225
4225
(-)formatter/org/eclipse/jdt/internal/formatter/DefaultCodeFormatterOptions.java (-11 / +48 lines)
Lines 135-141 Link Here
135
	public boolean indent_switchstatements_compare_to_switch;
135
	public boolean indent_switchstatements_compare_to_switch;
136
	public int indentation_size;
136
	public int indentation_size;
137
137
138
	public boolean insert_new_line_after_annotation_on_member;
138
	public boolean insert_new_line_after_annotation_on_type;
139
	public boolean insert_new_line_after_annotation_on_field;
140
	public boolean insert_new_line_after_annotation_on_method;
141
	public boolean insert_new_line_after_annotation_on_package;
139
	public boolean insert_new_line_after_annotation_on_parameter;
142
	public boolean insert_new_line_after_annotation_on_parameter;
140
	public boolean insert_new_line_after_annotation_on_local_variable;
143
	public boolean insert_new_line_after_annotation_on_local_variable;
141
	public boolean insert_new_line_after_label;
144
	public boolean insert_new_line_after_label;
Lines 421-427 Link Here
421
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
424
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES, this.indent_switchstatements_compare_to_cases ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
422
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
425
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH, this.indent_switchstatements_compare_to_switch ? DefaultCodeFormatterConstants.TRUE : DefaultCodeFormatterConstants.FALSE);
423
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
426
		options.put(DefaultCodeFormatterConstants.FORMATTER_INDENTATION_SIZE, Integer.toString(this.indentation_size));
424
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER, this.insert_new_line_after_annotation_on_member ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
427
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, this.insert_new_line_after_annotation_on_type ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
428
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, this.insert_new_line_after_annotation_on_field ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
429
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, this.insert_new_line_after_annotation_on_method ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
430
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, this.insert_new_line_after_annotation_on_package ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
425
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, this.insert_new_line_after_annotation_on_parameter ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
431
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, this.insert_new_line_after_annotation_on_parameter ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
426
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, this.insert_new_line_after_annotation_on_local_variable ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
432
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, this.insert_new_line_after_annotation_on_local_variable ? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
427
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_after_opening_brace_in_array_initializer? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
433
		options.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER, this.insert_new_line_after_opening_brace_in_array_initializer? JavaCore.INSERT : JavaCore.DO_NOT_INSERT);
Lines 2028-2043 Link Here
2028
				this.comment_clear_blank_lines_in_block_comment = DefaultCodeFormatterConstants.TRUE.equals(commentClearBlankLinesInBlockCommentOption);
2034
				this.comment_clear_blank_lines_in_block_comment = DefaultCodeFormatterConstants.TRUE.equals(commentClearBlankLinesInBlockCommentOption);
2029
			}
2035
			}
2030
		}
2036
		}
2031
		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
2037
		// New line after annotations
2032
		final Object insertNewLineAfterAnnotationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION);
2038
		final Object insertNewLineAfterAnnotationOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION);
2033
		if (insertNewLineAfterAnnotationOption != null) { // check if deprecated option was used
2039
		if (insertNewLineAfterAnnotationOption != null) { // check if deprecated 3.1 option was used
2034
			this.insert_new_line_after_annotation_on_member = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOption);
2040
			boolean insert = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOption);
2035
			this.insert_new_line_after_annotation_on_parameter = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOption);
2041
			this.insert_new_line_after_annotation_on_type = insert;
2036
			this.insert_new_line_after_annotation_on_local_variable = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOption);
2042
			this.insert_new_line_after_annotation_on_field = insert;
2043
			this.insert_new_line_after_annotation_on_method = insert;
2044
			this.insert_new_line_after_annotation_on_package = insert;
2045
			this.insert_new_line_after_annotation_on_parameter = insert;
2046
			this.insert_new_line_after_annotation_on_local_variable = insert;
2037
		} else {
2047
		} else {
2038
			final Object insertNewLineAfterAnnotationOnMemberOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER);
2048
			final Object insertNewLineAfterAnnotationOnMemberOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER);
2039
			if (insertNewLineAfterAnnotationOnMemberOption != null) { // otherwhise, use the new options
2049
			if (insertNewLineAfterAnnotationOnMemberOption != null) { // check if deprecated 3.4 option was used
2040
				this.insert_new_line_after_annotation_on_member = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnMemberOption);
2050
				boolean insert = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnMemberOption);
2051
				this.insert_new_line_after_annotation_on_type = insert;
2052
				this.insert_new_line_after_annotation_on_field = insert;
2053
				this.insert_new_line_after_annotation_on_method = insert;
2054
				this.insert_new_line_after_annotation_on_package = insert;
2055
			} else { // otherwise use new options
2056
				final Object insertNewLineAfterAnnotationOnTypeOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE);
2057
				if (insertNewLineAfterAnnotationOnTypeOption != null) {
2058
					this.insert_new_line_after_annotation_on_type = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnTypeOption);
2059
				}
2060
				final Object insertNewLineAfterAnnotationOnFieldOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD);
2061
				if (insertNewLineAfterAnnotationOnFieldOption != null) {
2062
					this.insert_new_line_after_annotation_on_field = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnFieldOption);
2063
				}
2064
				final Object insertNewLineAfterAnnotationOnMethodOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD);
2065
				if (insertNewLineAfterAnnotationOnMethodOption != null) {
2066
					this.insert_new_line_after_annotation_on_method = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnMethodOption);
2067
				}
2068
				final Object insertNewLineAfterAnnotationOnPackageOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE);
2069
				if (insertNewLineAfterAnnotationOnPackageOption != null) {
2070
					this.insert_new_line_after_annotation_on_package = JavaCore.INSERT.equals(insertNewLineAfterAnnotationOnPackageOption);
2071
				}
2041
			}
2072
			}
2042
			final Object insertNewLineAfterAnnotationOnParameterOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER);
2073
			final Object insertNewLineAfterAnnotationOnParameterOption = settings.get(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER);
2043
			if (insertNewLineAfterAnnotationOnParameterOption != null) {
2074
			if (insertNewLineAfterAnnotationOnParameterOption != null) {
Lines 2126-2132 Link Here
2126
		this.indent_switchstatements_compare_to_cases = true;
2157
		this.indent_switchstatements_compare_to_cases = true;
2127
		this.indent_switchstatements_compare_to_switch = true;
2158
		this.indent_switchstatements_compare_to_switch = true;
2128
		this.indentation_size = 4;
2159
		this.indentation_size = 4;
2129
		this.insert_new_line_after_annotation_on_member = true;
2160
		this.insert_new_line_after_annotation_on_type = true;
2161
		this.insert_new_line_after_annotation_on_field = true;
2162
		this.insert_new_line_after_annotation_on_method = true;
2163
		this.insert_new_line_after_annotation_on_package = true;
2130
		this.insert_new_line_after_annotation_on_parameter = false;
2164
		this.insert_new_line_after_annotation_on_parameter = false;
2131
		this.insert_new_line_after_annotation_on_local_variable = true;
2165
		this.insert_new_line_after_annotation_on_local_variable = true;
2132
		this.insert_new_line_after_opening_brace_in_array_initializer = false;
2166
		this.insert_new_line_after_opening_brace_in_array_initializer = false;
Lines 2401-2407 Link Here
2401
		this.indent_switchstatements_compare_to_cases = true;
2435
		this.indent_switchstatements_compare_to_cases = true;
2402
		this.indent_switchstatements_compare_to_switch = false;
2436
		this.indent_switchstatements_compare_to_switch = false;
2403
		this.indentation_size = 4;
2437
		this.indentation_size = 4;
2404
		this.insert_new_line_after_annotation_on_member = true;
2438
		this.insert_new_line_after_annotation_on_type = true;
2439
		this.insert_new_line_after_annotation_on_field = true;
2440
		this.insert_new_line_after_annotation_on_method = true;
2441
		this.insert_new_line_after_annotation_on_package = true;
2405
		this.insert_new_line_after_annotation_on_parameter = false;
2442
		this.insert_new_line_after_annotation_on_parameter = false;
2406
		this.insert_new_line_after_annotation_on_local_variable = true;
2443
		this.insert_new_line_after_annotation_on_local_variable = true;
2407
		this.insert_new_line_after_opening_brace_in_array_initializer = false;
2444
		this.insert_new_line_after_opening_brace_in_array_initializer = false;
(-)formatter/org/eclipse/jdt/internal/formatter/ICodeFormatterConstants.java (-4 / +13 lines)
Lines 24-35 Link Here
24
	/** annotation on unspecified source*/
24
	/** annotation on unspecified source*/
25
	public static final int ANNOTATION_UNSPECIFIED = 0;
25
	public static final int ANNOTATION_UNSPECIFIED = 0;
26
26
27
	/** annotation on a member (type, method, field) */
27
	/** annotation on a type */
28
	public static final int ANNOTATION_ON_MEMBER = 1;
28
	public static final int ANNOTATION_ON_TYPE = 1;
29
30
	/** annotation on a field */
31
	public static final int ANNOTATION_ON_FIELD = 2;
32
33
	/** annotation on a method */
34
	public static final int ANNOTATION_ON_METHOD = 3;
35
36
	/** annotation on a package */
37
	public static final int ANNOTATION_ON_PACKAGE = 4;
29
38
30
	/** annotation on a parameter */
39
	/** annotation on a parameter */
31
	public static final int ANNOTATION_ON_PARAMETER = 2;
40
	public static final int ANNOTATION_ON_PARAMETER = 5;
32
41
33
	/** annotation on a local variable */
42
	/** annotation on a local variable */
34
	public static final int ANNOTATION_ON_LOCAL_VARIABLE = 3;
43
	public static final int ANNOTATION_ON_LOCAL_VARIABLE = 6;
35
}
44
}
(-)formatter/org/eclipse/jdt/internal/formatter/Scribe.java (-2 / +17 lines)
Lines 4514-4521 Link Here
4514
							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
4514
							// https://bugs.eclipse.org/bugs/show_bug.cgi?id=122247
4515
							boolean shouldAddNewLine = false;
4515
							boolean shouldAddNewLine = false;
4516
							switch (annotationSourceKind) {
4516
							switch (annotationSourceKind) {
4517
								case ICodeFormatterConstants.ANNOTATION_ON_MEMBER :
4517
								case ICodeFormatterConstants.ANNOTATION_ON_TYPE :
4518
									if (this.formatter.preferences.insert_new_line_after_annotation_on_member) {
4518
									if (this.formatter.preferences.insert_new_line_after_annotation_on_type) {
4519
										shouldAddNewLine = true;
4520
									}
4521
									break;
4522
								case ICodeFormatterConstants.ANNOTATION_ON_FIELD :
4523
									if (this.formatter.preferences.insert_new_line_after_annotation_on_field) {
4524
										shouldAddNewLine = true;
4525
									}
4526
									break;
4527
								case ICodeFormatterConstants.ANNOTATION_ON_METHOD :
4528
									if (this.formatter.preferences.insert_new_line_after_annotation_on_method) {
4529
										shouldAddNewLine = true;
4530
									}
4531
									break;
4532
								case ICodeFormatterConstants.ANNOTATION_ON_PACKAGE :
4533
									if (this.formatter.preferences.insert_new_line_after_annotation_on_package) {
4519
										shouldAddNewLine = true;
4534
										shouldAddNewLine = true;
4520
									}
4535
									}
4521
									break;
4536
									break;
(-)model/org/eclipse/jdt/internal/core/JavaModelManager.java (+37 lines)
Lines 2074-2079 Link Here
2074
2074
2075
		// backward compatibility
2075
		// backward compatibility
2076
		addDeprecatedOptions(options);
2076
		addDeprecatedOptions(options);
2077
		try {
2078
			final IEclipsePreferences eclipsePreferences = this.preferencesLookup[PREF_INSTANCE];
2079
			String[] instanceKeys = eclipsePreferences.keys();
2080
			for (int i=0, length=instanceKeys.length; i<length; i++) {
2081
				String optionName = instanceKeys[i];
2082
				migrateObsoleteOption(options, optionName, eclipsePreferences.get(optionName, null));
2083
			}
2084
		} catch (BackingStoreException e) {
2085
			// skip
2086
		}
2077
2087
2078
		Util.fixTaskTags(options);
2088
		Util.fixTaskTags(options);
2079
		// store built map in cache
2089
		// store built map in cache
Lines 2083-2088 Link Here
2083
		return options;
2093
		return options;
2084
	}
2094
	}
2085
2095
2096
	/**
2097
	 * Migrates an old option value to its the new corresponding option name(s)
2098
	 * when necessary.
2099
	 * <p>
2100
	 * Nothing is done if the given option is not obsolete or if no migration has been
2101
	 * specified for it.
2102
	 * </p><p>
2103
	 * Migration is only setup for formatter options.
2104
	 * </p>
2105
	 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=308000"
2106
	 * 
2107
	 * @param options The options map to update
2108
	 * @param optionName The old option name to update
2109
	 * @param optionValue The value of the old option name
2110
	 */
2111
	public void migrateObsoleteOption(Map options, String optionName, String optionValue) {
2112
2113
		// Migrate formatter options
2114
		String[] compatibleConstants = DefaultCodeFormatterConstants.getCompatibleConstants(optionName);
2115
		if (compatibleConstants != null) {
2116
			for (int i=0, length=compatibleConstants.length; i < length; i++) {
2117
				options.put(compatibleConstants[i], optionValue);
2118
			}
2119
			return;
2120
		}
2121
	}
2122
2086
	// Do not modify without modifying getDefaultOptions()
2123
	// Do not modify without modifying getDefaultOptions()
2087
	private Hashtable getDefaultOptionsNoInitialization() {
2124
	private Hashtable getDefaultOptionsNoInitialization() {
2088
		Map defaultOptionsMap = new CompilerOptions().getMap(); // compiler defaults
2125
		Map defaultOptionsMap = new CompilerOptions().getMap(); // compiler defaults
(-)model/org/eclipse/jdt/internal/core/JavaProject.java (-3 / +9 lines)
Lines 1637-1643 Link Here
1637
		// Get project specific options
1637
		// Get project specific options
1638
		JavaModelManager.PerProjectInfo perProjectInfo = null;
1638
		JavaModelManager.PerProjectInfo perProjectInfo = null;
1639
		Hashtable projectOptions = null;
1639
		Hashtable projectOptions = null;
1640
		HashSet optionNames = JavaModelManager.getJavaModelManager().optionNames;
1640
		JavaModelManager javaModelManager = JavaModelManager.getJavaModelManager();
1641
		HashSet optionNames = javaModelManager.optionNames;
1641
		try {
1642
		try {
1642
			perProjectInfo = getPerProjectInfo();
1643
			perProjectInfo = getPerProjectInfo();
1643
			projectOptions = perProjectInfo.options;
1644
			projectOptions = perProjectInfo.options;
Lines 1651-1658 Link Here
1651
				for (int i = 0; i < propertyNames.length; i++){
1652
				for (int i = 0; i < propertyNames.length; i++){
1652
					String propertyName = propertyNames[i];
1653
					String propertyName = propertyNames[i];
1653
					String value = projectPreferences.get(propertyName, null);
1654
					String value = projectPreferences.get(propertyName, null);
1654
					if (value != null && optionNames.contains(propertyName)){
1655
					if (value != null) {
1655
						projectOptions.put(propertyName, value.trim());
1656
						if (optionNames.contains(propertyName)){
1657
							projectOptions.put(propertyName, value.trim());
1658
						} else {
1659
							// Maybe an obsolete preference, try to migrate it...
1660
							javaModelManager.migrateObsoleteOption(projectOptions, propertyName, value.trim());
1661
						}
1656
					}
1662
					}
1657
				}
1663
				}
1658
				// cache project options
1664
				// cache project options
(-)src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java (-8 / +201 lines)
Lines 10364-10370 Link Here
10364
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10364
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10365
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10365
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10366
		preferences.line_separator = "\n";//$NON-NLS-1$
10366
		preferences.line_separator = "\n";//$NON-NLS-1$
10367
		preferences.insert_new_line_after_annotation_on_member = false;
10367
		preferences.insert_new_line_after_annotation_on_type = false;
10368
		preferences.insert_new_line_after_annotation_on_field = false;
10369
		preferences.insert_new_line_after_annotation_on_method = false;
10370
		preferences.insert_new_line_after_annotation_on_package = false;
10368
		preferences.insert_new_line_after_annotation_on_parameter = true;
10371
		preferences.insert_new_line_after_annotation_on_parameter = true;
10369
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10372
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10370
		IRegion[] regions = new IRegion[] {
10373
		IRegion[] regions = new IRegion[] {
Lines 10378-10384 Link Here
10378
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10381
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10379
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10382
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10380
		preferences.line_separator = "\n";//$NON-NLS-1$
10383
		preferences.line_separator = "\n";//$NON-NLS-1$
10381
		preferences.insert_new_line_after_annotation_on_member = false;
10384
		preferences.insert_new_line_after_annotation_on_type = false;
10385
		preferences.insert_new_line_after_annotation_on_field = false;
10386
		preferences.insert_new_line_after_annotation_on_method = false;
10387
		preferences.insert_new_line_after_annotation_on_package = false;
10382
		preferences.insert_new_line_after_annotation_on_parameter = false;
10388
		preferences.insert_new_line_after_annotation_on_parameter = false;
10383
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10389
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
10384
		IRegion[] regions = new IRegion[] {
10390
		IRegion[] regions = new IRegion[] {
Lines 10393-10399 Link Here
10393
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10399
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10394
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10400
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10395
		preferences.line_separator = "\n";//$NON-NLS-1$
10401
		preferences.line_separator = "\n";//$NON-NLS-1$
10396
		preferences.insert_new_line_after_annotation_on_member = false;
10402
		preferences.insert_new_line_after_annotation_on_type = false;
10403
		preferences.insert_new_line_after_annotation_on_field = false;
10404
		preferences.insert_new_line_after_annotation_on_method = false;
10405
		preferences.insert_new_line_after_annotation_on_package = false;
10397
		preferences.insert_new_line_after_annotation_on_parameter = true;
10406
		preferences.insert_new_line_after_annotation_on_parameter = true;
10398
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10407
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10399
		Hashtable javaCoreOptions = JavaCore.getOptions();
10408
		Hashtable javaCoreOptions = JavaCore.getOptions();
Lines 10419-10425 Link Here
10419
	public void test707() {
10428
	public void test707() {
10420
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10429
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10421
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10430
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10422
		preferences.insert_new_line_after_annotation_on_member = true;
10431
		preferences.insert_new_line_after_annotation_on_type = true;
10432
		preferences.insert_new_line_after_annotation_on_field = true;
10433
		preferences.insert_new_line_after_annotation_on_method = true;
10434
		preferences.insert_new_line_after_annotation_on_package = true;
10423
		preferences.insert_new_line_after_annotation_on_parameter = true;
10435
		preferences.insert_new_line_after_annotation_on_parameter = true;
10424
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10436
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10425
		preferences.line_separator = "\n";//$NON-NLS-1$
10437
		preferences.line_separator = "\n";//$NON-NLS-1$
Lines 10447-10453 Link Here
10447
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10459
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10448
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10460
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10449
		preferences.line_separator = "\n";//$NON-NLS-1$
10461
		preferences.line_separator = "\n";//$NON-NLS-1$
10450
		preferences.insert_new_line_after_annotation_on_member = true;
10462
		preferences.insert_new_line_after_annotation_on_type = true;
10463
		preferences.insert_new_line_after_annotation_on_field = true;
10464
		preferences.insert_new_line_after_annotation_on_method = true;
10465
		preferences.insert_new_line_after_annotation_on_package = true;
10451
		preferences.insert_new_line_after_annotation_on_parameter = false;
10466
		preferences.insert_new_line_after_annotation_on_parameter = false;
10452
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10467
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10453
		Hashtable javaCoreOptions = JavaCore.getOptions();
10468
		Hashtable javaCoreOptions = JavaCore.getOptions();
Lines 10473-10479 Link Here
10473
	public void test709() {
10488
	public void test709() {
10474
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10489
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10475
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10490
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10476
		preferences.insert_new_line_after_annotation_on_member = false;
10491
		preferences.insert_new_line_after_annotation_on_type = false;
10492
		preferences.insert_new_line_after_annotation_on_field = false;
10493
		preferences.insert_new_line_after_annotation_on_method = false;
10494
		preferences.insert_new_line_after_annotation_on_package = false;
10477
		preferences.insert_new_line_after_annotation_on_parameter = false;
10495
		preferences.insert_new_line_after_annotation_on_parameter = false;
10478
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10496
		preferences.insert_new_line_after_annotation_on_local_variable = false;
10479
		preferences.line_separator = "\n";//$NON-NLS-1$
10497
		preferences.line_separator = "\n";//$NON-NLS-1$
Lines 10500-10506 Link Here
10500
	public void test710() {
10518
	public void test710() {
10501
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10519
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10502
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10520
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10503
		preferences.insert_new_line_after_annotation_on_member = false;
10521
		preferences.insert_new_line_after_annotation_on_type = false;
10522
		preferences.insert_new_line_after_annotation_on_field = false;
10523
		preferences.insert_new_line_after_annotation_on_method = false;
10524
		preferences.insert_new_line_after_annotation_on_package = false;
10504
		preferences.insert_new_line_after_annotation_on_parameter = true;
10525
		preferences.insert_new_line_after_annotation_on_parameter = true;
10505
		preferences.insert_new_line_after_annotation_on_local_variable = true;
10526
		preferences.insert_new_line_after_annotation_on_local_variable = true;
10506
		preferences.line_separator = "\n";//$NON-NLS-1$
10527
		preferences.line_separator = "\n";//$NON-NLS-1$
Lines 10527-10533 Link Here
10527
	public void test711() {
10548
	public void test711() {
10528
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10549
		final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
10529
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10550
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
10530
		preferences.insert_new_line_after_annotation_on_member = false;
10551
		preferences.insert_new_line_after_annotation_on_type = false;
10552
		preferences.insert_new_line_after_annotation_on_field = false;
10553
		preferences.insert_new_line_after_annotation_on_method = false;
10554
		preferences.insert_new_line_after_annotation_on_package = false;
10531
		preferences.insert_new_line_after_annotation_on_parameter = false;
10555
		preferences.insert_new_line_after_annotation_on_parameter = false;
10532
		preferences.insert_new_line_after_annotation_on_local_variable = true;
10556
		preferences.insert_new_line_after_annotation_on_local_variable = true;
10533
		preferences.line_separator = "\n";//$NON-NLS-1$
10557
		preferences.line_separator = "\n";//$NON-NLS-1$
Lines 10726-10729 Link Here
10726
		"}\n"
10750
		"}\n"
10727
	);
10751
	);
10728
}
10752
}
10753
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=308000
10754
public void test725() {
10755
	this.formatterPrefs = null;
10756
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10757
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10758
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10759
	String source =
10760
		"@Deprecated package pack;\n" + 
10761
		"public class Test {\n" + 
10762
		"    @Deprecated Test(String s) {}\n" + 
10763
		"    @Deprecated String label;\n" + 
10764
		"    @Deprecated void foo() {}\n" + 
10765
		"    @Deprecated interface I {}\n" + 
10766
		"}\n";
10767
	formatSource(source,
10768
		"@Deprecated\n" +
10769
		"package pack;\n" + 
10770
		"\n" + 
10771
		"public class Test {\n" + 
10772
		"	@Deprecated\n" + 
10773
		"	Test(String s) {\n" + 
10774
		"	}\n" + 
10775
		"\n" + 
10776
		"	@Deprecated\n" + 
10777
		"	String label;\n" + 
10778
		"\n" + 
10779
		"	@Deprecated\n" + 
10780
		"	void foo() {\n" + 
10781
		"	}\n" + 
10782
		"\n" + 
10783
		"	@Deprecated\n" + 
10784
		"	interface I {\n" + 
10785
		"	}\n" + 
10786
		"}\n"
10787
	);
10788
}
10789
public void test726() {
10790
	this.formatterPrefs = null;
10791
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10792
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10793
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10794
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE, DefaultCodeFormatterConstants.FALSE);
10795
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD, DefaultCodeFormatterConstants.FALSE);
10796
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD, DefaultCodeFormatterConstants.FALSE);
10797
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE, DefaultCodeFormatterConstants.FALSE);
10798
	String source =
10799
		"@Deprecated package pack;\n" + 
10800
		"public class Test {\n" + 
10801
		"    @Deprecated Test(String s) {}\n" + 
10802
		"    @Deprecated String label;\n" + 
10803
		"    @Deprecated void foo() {}\n" + 
10804
		"    @Deprecated interface I {}\n" + 
10805
		"}\n";
10806
	formatSource(source,
10807
		"@Deprecated package pack;\n" + 
10808
		"\n" + 
10809
		"public class Test {\n" + 
10810
		"	@Deprecated Test(String s) {\n" + 
10811
		"	}\n" + 
10812
		"\n" + 
10813
		"	@Deprecated String label;\n" + 
10814
		"\n" + 
10815
		"	@Deprecated void foo() {\n" + 
10816
		"	}\n" + 
10817
		"\n" + 
10818
		"	@Deprecated interface I {\n" + 
10819
		"	}\n" + 
10820
		"}\n"
10821
	);
10822
}
10823
10824
/**
10825
 * @deprecated Use a deprecated formatter option.
10826
 */
10827
public void test727() {
10828
	this.formatterPrefs = null;
10829
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10830
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10831
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10832
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE, DefaultCodeFormatterConstants.TRUE);
10833
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER, DefaultCodeFormatterConstants.FALSE);
10834
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER, DefaultCodeFormatterConstants.FALSE);
10835
	String source =
10836
		"@Deprecated package pack;\n" + 
10837
		"public class Test {\n" + 
10838
		"    @Deprecated Test(String s) {}\n" + 
10839
		"    @Deprecated String label;\n" + 
10840
		"    @Deprecated void foo() {}\n" + 
10841
		"    @Deprecated interface I {}\n" + 
10842
		"}\n";
10843
	formatSource(source,
10844
		"@Deprecated package pack;\n" + 
10845
		"\n" + 
10846
		"public class Test {\n" + 
10847
		"	@Deprecated Test(String s) {\n" + 
10848
		"	}\n" + 
10849
		"\n" + 
10850
		"	@Deprecated String label;\n" + 
10851
		"\n" + 
10852
		"	@Deprecated void foo() {\n" + 
10853
		"	}\n" + 
10854
		"\n" + 
10855
		"	@Deprecated interface I {\n" + 
10856
		"	}\n" + 
10857
		"}\n"
10858
	);
10859
}
10860
10861
/**
10862
 * @deprecated Use a deprecated formatter option.
10863
 */
10864
public void test728() {
10865
	this.formatterPrefs = null;
10866
	this.formatterOptions.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_6);
10867
	this.formatterOptions.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_6);
10868
	this.formatterOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_6);
10869
	this.formatterOptions.put(DefaultCodeFormatterConstants.FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION, DefaultCodeFormatterConstants.FALSE);
10870
	String source =
10871
		"@Deprecated package pack;\n" + 
10872
		"public class Test {\n" + 
10873
		"    @Deprecated Test(String s) {}\n" + 
10874
		"    @Deprecated String label;\n" + 
10875
		"    @Deprecated void foo() {}\n" + 
10876
		"    @Deprecated interface I {}\n" + 
10877
		"}\n";
10878
	formatSource(source,
10879
		"@Deprecated package pack;\n" + 
10880
		"\n" + 
10881
		"public class Test {\n" + 
10882
		"	@Deprecated Test(String s) {\n" + 
10883
		"	}\n" + 
10884
		"\n" + 
10885
		"	@Deprecated String label;\n" + 
10886
		"\n" + 
10887
		"	@Deprecated void foo() {\n" + 
10888
		"	}\n" + 
10889
		"\n" + 
10890
		"	@Deprecated interface I {\n" + 
10891
		"	}\n" + 
10892
		"}\n"
10893
	);
10894
}
10895
public void testONLY_729() {
10896
	this.formatterPrefs = null;
10897
	String profilePath = getResource("profiles", "b308000.xml");
10898
	this.formatterOptions = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(profilePath, "b308000");
10899
	assertNotNull("No preferences", this.formatterOptions);
10900
	String source =
10901
		"package p;\n" + 
10902
		"\n" + 
10903
		"@Deprecated public class C {\n" + 
10904
		"	@Deprecated public static void main(@Deprecated String[] args) {\n" + 
10905
		"		@Deprecated int i= 2;\n" + 
10906
		"		System.out.println(i);\n" + 
10907
		"	}\n" + 
10908
		"}\n";
10909
	formatSource(source,
10910
		"package p;\n" + 
10911
		"\n" + 
10912
		"@Deprecated public class C {\n" + 
10913
		"	@Deprecated public static void main(@Deprecated String[] args) {\n" + 
10914
		"		@Deprecated\n" + 
10915
		"		int i = 2;\n" + 
10916
		"		System.out.println(i);\n" + 
10917
		"	}\n" + 
10918
		"}\n"
10919
	);
10920
}
10921
10729
}
10922
}
(-)workspace/Formatter/profiles/b308000.xml (+279 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<profiles version="11">
3
<profile kind="CodeFormatterProfile" name="b308000" version="11">
4
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
5
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
6
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
7
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
8
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
9
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
10
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
11
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
12
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
13
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
14
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
15
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
16
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
17
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
18
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
19
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
20
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
21
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
22
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
23
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
24
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
25
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
26
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
27
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
28
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
29
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
30
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
31
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
32
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
33
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
34
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
35
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
36
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
37
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
38
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
39
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
40
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
41
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
42
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
43
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
44
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
45
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
46
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
47
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
48
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
49
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
50
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
51
<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
52
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
53
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
54
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
55
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
56
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
57
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
58
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
59
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
60
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
61
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
62
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
63
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
64
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
65
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
66
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
67
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
68
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
69
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
70
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
71
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
72
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
73
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
74
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
75
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
76
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
77
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
78
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
79
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
80
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
81
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
82
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
83
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
84
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
85
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
86
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
87
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
88
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
89
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
90
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
91
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
92
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
93
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
94
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
95
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
96
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
97
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
98
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
99
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
100
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
101
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
102
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
103
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
104
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
105
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
106
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
107
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
108
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
109
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
110
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
111
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
112
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
113
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
114
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
115
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
116
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
117
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
118
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
119
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
120
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
121
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
122
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
123
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
124
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
125
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
126
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
127
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
128
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
129
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
130
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
131
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
132
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
133
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
134
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
135
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
136
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
137
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
138
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
139
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
140
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
141
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
142
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
143
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
144
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
145
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
146
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
147
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
148
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
149
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
150
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
151
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
152
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
153
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
154
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
155
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
156
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
157
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
158
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
159
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
160
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
161
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
162
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
163
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
164
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
165
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
166
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
167
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
168
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
169
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
170
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
171
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
172
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
173
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
174
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
175
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
176
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
177
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
178
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
179
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
180
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
181
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
182
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
183
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
184
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
185
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
186
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
187
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
188
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
189
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
190
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
191
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
192
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
193
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
194
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
195
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
196
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
197
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
198
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
199
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
200
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
201
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
202
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
203
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
204
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
205
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
206
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
207
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
208
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
209
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
210
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
211
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
212
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
213
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
214
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
215
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
216
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
217
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
218
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
219
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
220
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
221
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
222
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
223
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
224
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
225
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
226
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
227
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
228
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
229
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
230
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
231
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
232
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
233
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
234
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
235
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
236
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
237
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
238
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
239
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
240
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
241
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
242
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
243
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="do not insert"/>
244
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
245
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
246
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
247
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
248
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
249
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
250
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
251
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
252
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
253
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
254
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
255
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
256
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
257
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
258
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
259
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
260
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
261
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
262
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
263
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
264
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
265
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
266
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
267
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
268
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
269
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
270
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
271
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
272
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
273
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
274
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
275
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
276
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
277
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
278
</profile>
279
</profiles>

Return to bug 308000