Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 353238 | Differences between
and this patch

Collapse All | Expand All

(-)batch/org/eclipse/jdt/internal/compiler/batch/messages.properties (-1 / +1 lines)
Lines 337-343 Link Here
337
\      unusedLocal        + unread local variable\n\
337
\      unusedLocal        + unread local variable\n\
338
\      unusedPrivate      + unused private member declaration\n\
338
\      unusedPrivate      + unused private member declaration\n\
339
\      unusedThrown         unused declared thrown exception\n\
339
\      unusedThrown         unused declared thrown exception\n\
340
\      unusedTypeArgs     + unused type arguments for method\n\
340
\      unusedTypeArgs     + unused type arguments for method and constructor\n\
341
\      uselessTypeCheck     unnecessary cast/instanceof operation\n\
341
\      uselessTypeCheck     unnecessary cast/instanceof operation\n\
342
\      varargsCast        + varargs argument need explicit cast\n\
342
\      varargsCast        + varargs argument need explicit cast\n\
343
\      warningToken       + unsupported or unnecessary @SuppressWarnings\n
343
\      warningToken       + unsupported or unnecessary @SuppressWarnings\n
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-1 / +30 lines)
Lines 1731-1737 Link Here
1731
        "      unusedLocal        + unread local variable\n" + 
1731
        "      unusedLocal        + unread local variable\n" + 
1732
        "      unusedPrivate      + unused private member declaration\n" + 
1732
        "      unusedPrivate      + unused private member declaration\n" + 
1733
        "      unusedThrown         unused declared thrown exception\n" + 
1733
        "      unusedThrown         unused declared thrown exception\n" + 
1734
        "      unusedTypeArgs     + unused type arguments for method\n" + 
1734
        "      unusedTypeArgs     + unused type arguments for method and constructor\n" + 
1735
        "      uselessTypeCheck     unnecessary cast/instanceof operation\n" + 
1735
        "      uselessTypeCheck     unnecessary cast/instanceof operation\n" + 
1736
        "      varargsCast        + varargs argument need explicit cast\n" + 
1736
        "      varargsCast        + varargs argument need explicit cast\n" + 
1737
        "      warningToken       + unsupported or unnecessary @SuppressWarnings\n" + 
1737
        "      warningToken       + unsupported or unnecessary @SuppressWarnings\n" + 
Lines 9038-9043 Link Here
9038
		"1 problem (1 warning)",
9038
		"1 problem (1 warning)",
9039
		true);
9039
		true);
9040
}
9040
}
9041
//-warn option - regression tests
9042
public void test230_warn_options() {
9043
	// same source as 190, skip check defaults
9044
	this.runConformTest(
9045
		new String[] {
9046
			"X.java",
9047
			"import java.util.ArrayList;\n" +
9048
			"public class X<T>{\n" +
9049
			"  public X() {\n" +
9050
			"  }\n" +
9051
			"  public X(T t){}\n" +
9052
			"  void foo() {\n" +
9053
			"      X<String> x = new X<String>();\n" +
9054
			"	   X<Number> x1 = new X<Number>(1);\n" +
9055
			"  }\n" +
9056
			"}\n"
9057
		},
9058
		"\"" + OUTPUT_DIR +  File.separator + "X.java\""
9059
		+ " -warn:unusedTypeArgs -proc:none -1.7 -d \"" + OUTPUT_DIR + "\"",
9060
		"",
9061
		"----------\n" + 
9062
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 7)\n" + 
9063
		"	X<String> x = new X<String>();\n" + 
9064
		"	                  ^\n" + 
9065
		"Redundant specification of type arguments <String>\n" + 
9066
		"----------\n" + 
9067
		"1 problem (1 warning)",
9068
		true);
9069
}
9041
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=216684
9070
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=216684
9042
// .java/.class files precedence depending on sourcepath and other conditions
9071
// .java/.class files precedence depending on sourcepath and other conditions
9043
// ecj always selects source files from the sourcepath over class files
9072
// ecj always selects source files from the sourcepath over class files
(-)guide/jdt_api_options.htm (+128 lines)
Lines 1211-1216 Link Here
1211
"../reference/api/org/eclipse/jdt/core/JavaCore.html#IGNORE"><i>IGNORE</i></a></b></td>
1211
"../reference/api/org/eclipse/jdt/core/JavaCore.html#IGNORE"><i>IGNORE</i></a></b></td>
1212
</tr>
1212
</tr>
1213
<tr>
1213
<tr>
1214
<tr>
1215
<td colspan="2"><a name="REDUNDANT_TYPE_ARGUMENTS" id="REDUNDANT_TYPE_ARGUMENTS"></a><b>Reporting Redundant
1216
Specification of type arguments for generic class instance creation</b> (<b><a href=
1217
"../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_REDUNDANT_TYPE_ARGUMENTS">COMPILER_PB_REDUNDANT_TYPE_ARGUMENTS</a></b>)</td>
1218
</tr>
1219
<tr valign="top">
1220
<td rowspan="3">When enabled, the compiler will issue an error or a warning whenever type arguments
1221
are specified in a generic instance creation expression, although the diamond operator '<>' could have
1222
been used instead.<br />
1223
1224
(java 1.7 and greater)</td>
1225
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#ERROR">ERROR</a></b></td>
1226
</tr>
1227
<tr valign="top">
1228
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#WARNING">WARNING</a></b></td>
1229
</tr>
1230
<tr valign="top">
1231
<td><b><a href=
1232
"../reference/api/org/eclipse/jdt/core/JavaCore.html#IGNORE"><i>IGNORE</i></a></b></td>
1233
</tr>
1234
<tr>
1214
<td colspan="2"><b>Reporting Attempt to Override Package Visible Method</b> (<b><a href=
1235
<td colspan="2"><b>Reporting Attempt to Override Package Visible Method</b> (<b><a href=
1215
"../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD">COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD</a></b>)</td>
1236
"../reference/api/org/eclipse/jdt/core/JavaCore.html#COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD">COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD</a></b>)</td>
1216
1237
Lines 2393-2398 Link Here
2393
<td>createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)</td>
2414
<td>createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)</td>
2394
</tr>
2415
</tr>
2395
<tr>
2416
<tr>
2417
<td colspan="2"><b>Option for alignment of arguments in try with resources statement</b> (<b><a href=
2418
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY">FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY</a></b>)</td>
2419
</tr>
2420
<tr valign="top">
2421
<td>Possible value</td>
2422
<td>values returned by <code>createAlignmentValue(boolean, int, int)</code> call</td>
2423
2424
</tr>
2425
<tr valign="top">
2426
<td>Default value</td>
2427
<td>createAlignmentValue(false, WRAP_NEXT_PER_LINE, INDENT_DEFAULT)</td>
2428
</tr>
2429
<tr>
2430
<td colspan="2"><b>Option for alignment of union type in multi-catch expression</b> (<b><a href=
2431
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH">FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH</a></b>)</td>
2432
</tr>
2433
<tr valign="top">
2434
<td>Possible value</td>
2435
<td>values returned by <code>createAlignmentValue(boolean, int, int)</code> call</td>
2436
2437
</tr>
2438
<tr valign="top">
2439
<td>Default value</td>
2440
<td>createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT)</td>
2441
</tr>
2442
<tr>
2396
<td colspan="2"><b>Option for alignment of assignment</b> (<b><a href=
2443
<td colspan="2"><b>Option for alignment of assignment</b> (<b><a href=
2397
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_ALIGNMENT_FOR_ASSIGNMENT">FORMATTER_ALIGNMENT_FOR_ASSIGNMENT</a></b>)</td>
2444
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_ALIGNMENT_FOR_ASSIGNMENT">FORMATTER_ALIGNMENT_FOR_ASSIGNMENT</a></b>)</td>
2398
2445
Lines 4574-4579 Link Here
4574
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
4621
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
4575
</tr>
4622
</tr>
4576
<tr>
4623
<tr>
4624
<td colspan="2"><b>Option to insert a space after the opening parenthesis in a try with resources
4625
statement</b> (<b><a href=
4626
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_TRY">FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_TRY</a></b>)</td>
4627
</tr>
4628
<tr valign="top">
4629
<td rowspan="2">Possible values</td>
4630
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#INSERT">INSERT</a></b></td>
4631
</tr>
4632
<tr valign="top">
4633
<td><b><a href=
4634
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
4635
</tr>
4636
<tr>
4577
<td colspan="2"><b>Option to insert a space after the opening parenthesis in a while statement</b>
4637
<td colspan="2"><b>Option to insert a space after the opening parenthesis in a while statement</b>
4578
(<b><a href=
4638
(<b><a href=
4579
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE">FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE</a></b>)</td>
4639
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE">FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE</a></b>)</td>
Lines 4655-4660 Link Here
4655
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT">DO_NOT_INSERT</a></b></td>
4715
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT">DO_NOT_INSERT</a></b></td>
4656
</tr>
4716
</tr>
4657
<tr>
4717
<tr>
4718
<td colspan="2"><b>Option to insert a space after each semicolon in a try with resources
4719
statement</b> (<b><a href=
4720
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_TRY_RESOURCES">FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_TRY_RESOURCES</a></b>)</td>
4721
</tr>
4722
<tr valign="top">
4723
<td rowspan="2">Possible values</td>
4724
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#INSERT"><i>INSERT</i></a></b></td>
4725
</tr>
4726
<tr valign="top">
4727
<td><b><a href=
4728
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT">DO_NOT_INSERT</a></b></td>
4729
</tr>
4730
<tr>
4658
<td colspan="2"><b>Option to insert a space after an unary operator</b> (<b><a href=
4731
<td colspan="2"><b>Option to insert a space after an unary operator</b> (<b><a href=
4659
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR">FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR</a></b>)</td>
4732
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR">FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR</a></b>)</td>
4660
4733
Lines 4976-4981 Link Here
4976
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
5049
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
4977
</tr>
5050
</tr>
4978
<tr>
5051
<tr>
5052
<td colspan="2"><b>Option to insert a space before closing paranthesis in a try with resources
5053
statement</b> (<b><a href=
5054
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY">FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY</a></b>)</td>
5055
</tr>
5056
<tr valign="top">
5057
<td rowspan="2">Possible values</td>
5058
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#INSERT">INSERT</a></b></td>
5059
</tr>
5060
<tr valign="top">
5061
<td><b><a href=
5062
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"></i>DO_NOT_INSERT</i></a></b></td>
5063
</tr>
5064
<tr>
4979
<td colspan="2"><b>Option to insert a space before the closing parenthesis in a while statement</b>
5065
<td colspan="2"><b>Option to insert a space before the closing parenthesis in a while statement</b>
4980
(<b><a href=
5066
(<b><a href=
4981
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE">FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE</a></b>)</td>
5067
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE">FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE</a></b>)</td>
Lines 5754-5759 Link Here
5754
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT">DO_NOT_INSERT</a></b></td>
5840
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT">DO_NOT_INSERT</a></b></td>
5755
</tr>
5841
</tr>
5756
<tr>
5842
<tr>
5843
<td colspan="2"><b>Option to insert a space before the opening parenthesis in a try with resources
5844
statement</b> (<b><a href=
5845
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_TRY">FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_TRY</a></b>)</td>
5846
5847
</tr>
5848
<tr valign="top">
5849
<td rowspan="2">Possible values</td>
5850
<td><b><a href=
5851
"../reference/api/org/eclipse/jdt/core/JavaCore.html#INSERT">INSERT</a></b></td>
5852
</tr>
5853
<tr valign="top">
5854
<td><b><a href=
5855
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
5856
</tr>
5857
<tr>
5757
<td colspan="2"><b>Option to insert a space before the opening parenthesis in a while statement</b>
5858
<td colspan="2"><b>Option to insert a space before the opening parenthesis in a while statement</b>
5758
(<b><a href=
5859
(<b><a href=
5759
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE">FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE</a></b>)</td>
5860
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE">FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE</a></b>)</td>
Lines 5879-5884 Link Here
5879
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
5980
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
5880
</tr>
5981
</tr>
5881
<tr>
5982
<tr>
5983
<td colspan="2"><b>Option to insert a space before each semicolon in try with resources statement</b> (<b><a href=
5984
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_TRY_RESOURCES">FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_TRY_RESOURCES</a></b>)</td>
5985
5986
</tr>
5987
<tr valign="top">
5988
<td rowspan="2">Possible values</td>
5989
<td><b><a href="../reference/api/org/eclipse/jdt/core/JavaCore.html#INSERT">INSERT</a></b></td>
5990
</tr>
5991
<tr valign="top">
5992
<td><b><a href=
5993
"../reference/api/org/eclipse/jdt/core/JavaCore.html#DO_NOT_INSERT"><i>DO_NOT_INSERT</i></a></b></td>
5994
</tr>
5995
<tr>
5882
<td colspan="2"><b>Option to insert a space before unary operator</b> (<b><a href=
5996
<td colspan="2"><b>Option to insert a space before unary operator</b> (<b><a href=
5883
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR">FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR</a></b>)</td>
5997
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR">FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR</a></b>)</td>
5884
5998
Lines 6202-6207 Link Here
6202
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FALSE">FALSE</a></b></td>
6316
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FALSE">FALSE</a></b></td>
6203
</tr>
6317
</tr>
6204
<tr>
6318
<tr>
6319
<td colspan="2"><b>Option to wrap before OR operator in a multi-catch expression</b> (<b><a href=
6320
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH">FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH</a></b>)</td>
6321
6322
</tr>
6323
<tr valign="top">
6324
<td rowspan="2">Possible values</td>
6325
<td><b><a href=
6326
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#TRUE"><i>TRUE</i></a></b></td>
6327
</tr>
6328
<tr valign="top">
6329
<td><b><a href=
6330
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FALSE">FALSE</a></b></td>
6331
</tr>
6332
<tr>
6205
<td colspan="2"><b>Option to wrap outer expressions in nested expressions</b> (<b><a href=
6333
<td colspan="2"><b>Option to wrap outer expressions in nested expressions</b> (<b><a href=
6206
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED">FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED</a></b>)</td>
6334
"../reference/api/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.html#FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED">FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED</a></b>)</td>
6207
6335
(-)tasks/task-using_batch_compiler.htm (-1 / +1 lines)
Lines 592-598 Link Here
592
<tr>
592
<tr>
593
<td align="center" valign="top">+</td>
593
<td align="center" valign="top">+</td>
594
<td align="left" valign="top">unusedTypeArgs</td>
594
<td align="left" valign="top">unusedTypeArgs</td>
595
<td valign="top">unused type arguments for method</td>
595
<td valign="top">unused type arguments for method and generic class instance creation</td>
596
</tr>
596
</tr>
597
<tr>
597
<tr>
598
<td align="center" valign="top">-</td>
598
<td align="center" valign="top">-</td>

Return to bug 353238