View | Details | Raw Unified | Return to bug 249535
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-9 / +28 lines)
Lines 8794-8799 Link Here
8794
8794
8795
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066
8795
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066
8796
public void test170() {
8796
public void test170() {
8797
	Map options = getCompilerOptions();
8798
	options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR);
8797
	this.runNegativeTest(
8799
	this.runNegativeTest(
8798
		new String[] {
8800
		new String[] {
8799
			"X.java",
8801
			"X.java",
Lines 8801-8816 Link Here
8801
			"class Y extends X { @Override void foo() { } }"
8803
			"class Y extends X { @Override void foo() { } }"
8802
		},
8804
		},
8803
		"----------\n" +
8805
		"----------\n" +
8804
		"1. WARNING in X.java (at line 2)\n" +
8806
		"1. ERROR in X.java (at line 2)\n" +
8805
		"	class Y extends X { @Override void foo() { } }\n" +
8807
		"	class Y extends X { @Override void foo() { } }\n" +
8806
		"	                                   ^^^^^\n" +
8808
		"	                                   ^^^^^\n" +
8807
		"The method Y.foo() is overriding a synchronized method without being synchronized\n" +
8809
		"The method Y.foo() is overriding a synchronized method without being synchronized\n" +
8808
		"----------\n"
8810
		"----------\n",
8809
	);
8811
	null,
8812
	false,
8813
	options);
8810
}
8814
}
8811
8815
8812
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation
8816
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation
8813
public void test171() {
8817
public void test171() {
8818
	Map options = getCompilerOptions();
8819
	options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR);
8814
	this.runNegativeTest(
8820
	this.runNegativeTest(
8815
		new String[] {
8821
		new String[] {
8816
			"X.java",
8822
			"X.java",
Lines 8820-8834 Link Here
8820
			"}"
8826
			"}"
8821
		},
8827
		},
8822
		"----------\n" +
8828
		"----------\n" +
8823
		"1. WARNING in X.java (at line 2)\n" +
8829
		"1. ERROR in X.java (at line 2)\n" +
8824
		"	FOO { @Override void foo() { super.foo(); } };\n" +
8830
		"	FOO { @Override void foo() { super.foo(); } };\n" +
8825
		"	                     ^^^^^\n" +
8831
		"	                     ^^^^^\n" +
8826
		"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" +
8832
		"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" +
8827
		"----------\n");
8833
		"----------\n",
8834
		null,
8835
		false,
8836
		options);
8828
}
8837
}
8829
8838
8830
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation
8839
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation
8831
public void test172() {
8840
public void test172() {
8841
	Map options = getCompilerOptions();
8842
	options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR);
8832
	this.runNegativeTest(
8843
	this.runNegativeTest(
8833
			new String[] {
8844
			new String[] {
8834
					"X.java",
8845
					"X.java",
Lines 8838-8852 Link Here
8838
					"}"
8849
					"}"
8839
			},
8850
			},
8840
			"----------\n" +
8851
			"----------\n" +
8841
			"1. WARNING in X.java (at line 2)\n" +
8852
			"1. ERROR in X.java (at line 2)\n" +
8842
			"	void bar() { new X() { @Override void foo() {} }; }\n"+
8853
			"	void bar() { new X() { @Override void foo() {} }; }\n"+
8843
			"	                                      ^^^^^\n" +
8854
			"	                                      ^^^^^\n" +
8844
			"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" +
8855
			"The method new X(){}.foo() is overriding a synchronized method without being synchronized\n" +
8845
			"----------\n");
8856
			"----------\n",
8857
			null,
8858
			false,
8859
			options);
8846
}
8860
}
8847
8861
8848
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation
8862
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=239066 - variation
8849
public void test173() {
8863
public void test173() {
8864
	Map options = getCompilerOptions();
8865
	options.put(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, CompilerOptions.ERROR);
8850
	this.runNegativeTest(
8866
	this.runNegativeTest(
8851
			new String[] {
8867
			new String[] {
8852
					"X.java",
8868
					"X.java",
Lines 8855-8865 Link Here
8855
					"class Z extends Y { @Override void foo() {} }\n"
8871
					"class Z extends Y { @Override void foo() {} }\n"
8856
			},
8872
			},
8857
			"----------\n" +
8873
			"----------\n" +
8858
			"1. WARNING in X.java (at line 3)\n" +
8874
			"1. ERROR in X.java (at line 3)\n" +
8859
			"	class Z extends Y { @Override void foo() {} }\n" +
8875
			"	class Z extends Y { @Override void foo() {} }\n" +
8860
			"	                                   ^^^^^\n" +
8876
			"	                                   ^^^^^\n" +
8861
			"The method Z.foo() is overriding a synchronized method without being synchronized\n" +
8877
			"The method Z.foo() is overriding a synchronized method without being synchronized\n" +
8862
	"----------\n");
8878
	"----------\n",
8879
	null,
8880
	false,
8881
	options);
8863
}
8882
}
8864
8883
8865
}
8884
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-2 / +2 lines)
Lines 1679-1685 Link Here
1679
        "      staticReceiver     + non-static reference to static member\n" +
1679
        "      staticReceiver     + non-static reference to static member\n" +
1680
        "      super                overriding a method without making a super invocation\n" +
1680
        "      super                overriding a method without making a super invocation\n" +
1681
        "      suppress           + enable @SuppressWarnings\n" +
1681
        "      suppress           + enable @SuppressWarnings\n" +
1682
        "      syncOverride       + missing synchronized in synchr. method override\n" +
1682
        "      syncOverride         missing synchronized in synchr. method override\n" +
1683
        "      syntheticAccess      synthetic access for innerclass\n" +
1683
        "      syntheticAccess      synthetic access for innerclass\n" +
1684
        "      tasks(<tags separated by |>) tasks identified by tags inside comments\n" +
1684
        "      tasks(<tags separated by |>) tasks identified by tags inside comments\n" +
1685
        "      typeHiding         + type parameter hiding another type\n" +
1685
        "      typeHiding         + type parameter hiding another type\n" +
Lines 1808-1814 Link Here
1808
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" +
1808
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" +
1809
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" +
1809
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" +
1810
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" +
1810
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" +
1811
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod\" value=\"warning\"/>\n" +
1811
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod\" value=\"ignore\"/>\n" +
1812
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" +
1812
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" +
1813
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion\" value=\"warning\"/>\n" +
1813
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion\" value=\"warning\"/>\n" +
1814
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" +
1814
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" +
(-)batch/org/eclipse/jdt/internal/compiler/batch/messages.properties (-1 / +1 lines)
Lines 276-282 Link Here
276
\      staticReceiver     + non-static reference to static member\n\
276
\      staticReceiver     + non-static reference to static member\n\
277
\      super                overriding a method without making a super invocation\n\
277
\      super                overriding a method without making a super invocation\n\
278
\      suppress           + enable @SuppressWarnings\n\
278
\      suppress           + enable @SuppressWarnings\n\
279
\      syncOverride       + missing synchronized in synchr. method override\n\
279
\      syncOverride         missing synchronized in synchr. method override\n\
280
\      syntheticAccess      synthetic access for innerclass\n\
280
\      syntheticAccess      synthetic access for innerclass\n\
281
\      tasks(<tags separated by |>) tasks identified by tags inside comments\n\
281
\      tasks(<tags separated by |>) tasks identified by tags inside comments\n\
282
\      typeHiding         + type parameter hiding another type\n\
282
\      typeHiding         + type parameter hiding another type\n\
(-)model/org/eclipse/jdt/core/JavaCore.java (-1 / +1 lines)
Lines 1476-1482 Link Here
1476
	 * <dl>
1476
	 * <dl>
1477
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"</code></dd>
1477
	 * <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod"</code></dd>
1478
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
1478
	 * <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd>
1479
	 * <dt>Default:</dt><dd><code>"warning"</code></dd>
1479
	 * <dt>Default:</dt><dd><code>"ignore"</code></dd>
1480
	 * </dl>
1480
	 * </dl>
1481
	 * @since 3.5
1481
	 * @since 3.5
1482
	 * @category CompilerOptionID
1482
	 * @category CompilerOptionID
(-)compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java (-2 / +1 lines)
Lines 117-124 Link Here
117
				| CompilerOptions.UnusedLabel
117
				| CompilerOptions.UnusedLabel
118
				| CompilerOptions.UnusedTypeArguments
118
				| CompilerOptions.UnusedTypeArguments
119
				| CompilerOptions.UnusedWarningToken
119
				| CompilerOptions.UnusedWarningToken
120
				| CompilerOptions.ComparingIdentical
120
				| CompilerOptions.ComparingIdentical);
121
				| CompilerOptions.MissingSynchronizedModifierInInheritedMethod);
122
			// group-2 warnings enabled by default
121
			// group-2 warnings enabled by default
123
			// next irritant goes here (group-1 is complete)						
122
			// next irritant goes here (group-1 is complete)						
124
			
123
			

Return to bug 249535