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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/DeprecatedTest.java (+62 lines)
Lines 796-801 Link Here
796
		// javac options
796
		// javac options
797
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
797
		JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
798
}
798
}
799
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206
800
public void test020() {
801
	Map customOptions = new HashMap();
802
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
803
	customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE);
804
	
805
	this.runConformTest(
806
			new String[] {
807
					"test1/E.java",
808
					"package test1;\n" + 
809
					"\n" + 
810
					"public class E implements I {\n" + 
811
					"	public I2 foo() {\n" + 
812
					"		return null;\n" + 
813
					"	}\n" + 
814
					"}\n" + 
815
					"interface I {\n" + 
816
					"	/** @deprecated */\n" + 
817
					"	public I2 foo();\n" + 
818
					"}\n" + 
819
					"/** @deprecated */\n" + 
820
					"interface I2 {}",
821
			},
822
			"", // expected output
823
			null,
824
			true, // flush previous output dir content
825
			null, // special vm args
826
			customOptions,  // custom options
827
			null); // custom requestor
828
}
829
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=247206
830
public void test021() {
831
	Map customOptions = new HashMap();
832
	customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR);
833
	customOptions.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.IGNORE);
834
	
835
	this.runConformTest(
836
			new String[] {
837
				"test1/E.java",
838
				"package test1;\n" + 
839
				"\n" + 
840
				"public class E implements I {\n" + 
841
				"	public I2 foo() {\n" + 
842
				"		return null;\n" + 
843
				"	}\n" + 
844
				"}\n" + 
845
				"interface I {\n" + 
846
				"	/** @deprecated */\n" + 
847
				"	public I2 foo();\n" + 
848
				"}\n",
849
				"test1/I2.java",
850
				"package test1;\n" + 
851
				"/** @deprecated */\n" + 
852
				"interface I2 {}",
853
			},
854
			"", // expected output
855
			null,
856
			true, // flush previous output dir content
857
			null, // special vm args
858
			customOptions,  // custom options
859
			null); // custom requestor
860
}
799
public static Class testClass() {
861
public static Class testClass() {
800
	return DeprecatedTest.class;
862
	return DeprecatedTest.class;
801
}
863
}

Return to bug 247206