Lines 164-170
Link Here
|
164 |
"----------\n" + |
164 |
"----------\n" + |
165 |
"2. WARNING in p\\Warning.java (at line 7)\n" + |
165 |
"2. WARNING in p\\Warning.java (at line 7)\n" + |
166 |
" dateObj.UTC(1,2,3,4,5,6);\n" + |
166 |
" dateObj.UTC(1,2,3,4,5,6);\n" + |
167 |
" ^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
167 |
" ^^^^^^^^^^^^^^^^\n" + |
168 |
"The method UTC(int, int, int, int, int, int) from the type Date is deprecated\n" + |
168 |
"The method UTC(int, int, int, int, int, int) from the type Date is deprecated\n" + |
169 |
"----------\n"); |
169 |
"----------\n"); |
170 |
} |
170 |
} |
Lines 197-203
Link Here
|
197 |
"----------\n" + |
197 |
"----------\n" + |
198 |
"1. WARNING in A.java (at line 1)\n" + |
198 |
"1. WARNING in A.java (at line 1)\n" + |
199 |
" public class A extends X.Y {}\n" + |
199 |
" public class A extends X.Y {}\n" + |
200 |
" ^^^\n" + |
200 |
" ^\n" + |
201 |
"The type X.Y is deprecated\n" + |
201 |
"The type X.Y is deprecated\n" + |
202 |
"----------\n",// expected output |
202 |
"----------\n",// expected output |
203 |
null, |
203 |
null, |
Lines 549-560
Link Here
|
549 |
"----------\n" + |
549 |
"----------\n" + |
550 |
"5. WARNING in Y.java (at line 9)\n" + |
550 |
"5. WARNING in Y.java (at line 9)\n" + |
551 |
" p.X x;\n" + |
551 |
" p.X x;\n" + |
552 |
" ^^^\n" + |
552 |
" ^\n" + |
553 |
"The type X is deprecated\n" + |
553 |
"The type X is deprecated\n" + |
554 |
"----------\n" + |
554 |
"----------\n" + |
555 |
"6. WARNING in Y.java (at line 10)\n" + |
555 |
"6. WARNING in Y.java (at line 10)\n" + |
556 |
" p.X[] xs = { x };\n" + |
556 |
" p.X[] xs = { x };\n" + |
557 |
" ^^^\n" + |
557 |
" ^\n" + |
558 |
"The type X is deprecated\n" + |
558 |
"The type X is deprecated\n" + |
559 |
"----------\n"); |
559 |
"----------\n"); |
560 |
} |
560 |
} |
Lines 594-610
Link Here
|
594 |
"----------\n" + /* expected compiler log */ |
594 |
"----------\n" + /* expected compiler log */ |
595 |
"1. ERROR in p\\M1.java (at line 4)\n" + |
595 |
"1. ERROR in p\\M1.java (at line 4)\n" + |
596 |
" a.N1.N2.N3 m = null;\n" + |
596 |
" a.N1.N2.N3 m = null;\n" + |
597 |
" ^^^^^^^\n" + |
597 |
" ^^\n" + |
598 |
"The type N1.N2 is deprecated\n" + |
598 |
"The type N1.N2 is deprecated\n" + |
599 |
"----------\n" + |
599 |
"----------\n" + |
600 |
"2. ERROR in p\\M1.java (at line 4)\n" + |
600 |
"2. ERROR in p\\M1.java (at line 4)\n" + |
601 |
" a.N1.N2.N3 m = null;\n" + |
601 |
" a.N1.N2.N3 m = null;\n" + |
602 |
" ^^^^^^^^^^\n" + |
602 |
" ^^\n" + |
603 |
"The type N1.N2.N3 is deprecated\n" + |
603 |
"The type N1.N2.N3 is deprecated\n" + |
604 |
"----------\n" + |
604 |
"----------\n" + |
605 |
"3. ERROR in p\\M1.java (at line 5)\n" + |
605 |
"3. ERROR in p\\M1.java (at line 5)\n" + |
606 |
" m.foo();\n" + |
606 |
" m.foo();\n" + |
607 |
" ^^^^^^^\n" + |
607 |
" ^^^^^\n" + |
608 |
"The method foo() from the type N1.N2.N3 is deprecated\n" + |
608 |
"The method foo() from the type N1.N2.N3 is deprecated\n" + |
609 |
"----------\n", |
609 |
"----------\n", |
610 |
// javac options |
610 |
// javac options |
Lines 646-662
Link Here
|
646 |
"----------\n" + /* expected compiler log */ |
646 |
"----------\n" + /* expected compiler log */ |
647 |
"1. ERROR in p\\M1.java (at line 4)\n" + |
647 |
"1. ERROR in p\\M1.java (at line 4)\n" + |
648 |
" a.N1.N2.N3 m = null;\n" + |
648 |
" a.N1.N2.N3 m = null;\n" + |
649 |
" ^^^^^^^\n" + |
649 |
" ^^\n" + |
650 |
"The type N1.N2 is deprecated\n" + |
650 |
"The type N1.N2 is deprecated\n" + |
651 |
"----------\n" + |
651 |
"----------\n" + |
652 |
"2. ERROR in p\\M1.java (at line 4)\n" + |
652 |
"2. ERROR in p\\M1.java (at line 4)\n" + |
653 |
" a.N1.N2.N3 m = null;\n" + |
653 |
" a.N1.N2.N3 m = null;\n" + |
654 |
" ^^^^^^^^^^\n" + |
654 |
" ^^\n" + |
655 |
"The type N1.N2.N3 is deprecated\n" + |
655 |
"The type N1.N2.N3 is deprecated\n" + |
656 |
"----------\n" + |
656 |
"----------\n" + |
657 |
"3. ERROR in p\\M1.java (at line 5)\n" + |
657 |
"3. ERROR in p\\M1.java (at line 5)\n" + |
658 |
" m.foo();\n" + |
658 |
" m.foo();\n" + |
659 |
" ^^^^^^^\n" + |
659 |
" ^^^^^\n" + |
660 |
"The method foo() from the type N1.N2.N3 is deprecated\n" + |
660 |
"The method foo() from the type N1.N2.N3 is deprecated\n" + |
661 |
"----------\n", |
661 |
"----------\n", |
662 |
// javac options |
662 |
// javac options |
Lines 742-758
Link Here
|
742 |
"----------\n" + /* expected compiler log */ |
742 |
"----------\n" + /* expected compiler log */ |
743 |
"1. ERROR in p\\M1.java (at line 4)\n" + |
743 |
"1. ERROR in p\\M1.java (at line 4)\n" + |
744 |
" a.N1.N2.N3 m = null;\n" + |
744 |
" a.N1.N2.N3 m = null;\n" + |
745 |
" ^^^^^^^\n" + |
745 |
" ^^\n" + |
746 |
"The type N1.N2 is deprecated\n" + |
746 |
"The type N1.N2 is deprecated\n" + |
747 |
"----------\n" + |
747 |
"----------\n" + |
748 |
"2. ERROR in p\\M1.java (at line 4)\n" + |
748 |
"2. ERROR in p\\M1.java (at line 4)\n" + |
749 |
" a.N1.N2.N3 m = null;\n" + |
749 |
" a.N1.N2.N3 m = null;\n" + |
750 |
" ^^^^^^^^^^\n" + |
750 |
" ^^\n" + |
751 |
"The type N1.N2.N3 is deprecated\n" + |
751 |
"The type N1.N2.N3 is deprecated\n" + |
752 |
"----------\n" + |
752 |
"----------\n" + |
753 |
"3. ERROR in p\\M1.java (at line 5)\n" + |
753 |
"3. ERROR in p\\M1.java (at line 5)\n" + |
754 |
" m.foo();\n" + |
754 |
" m.foo();\n" + |
755 |
" ^^^^^^^\n" + |
755 |
" ^^^^^\n" + |
756 |
"The method foo() from the type N1.N2.N3 is deprecated\n" + |
756 |
"The method foo() from the type N1.N2.N3 is deprecated\n" + |
757 |
"----------\n", |
757 |
"----------\n", |
758 |
// javac options |
758 |
// javac options |
Lines 799-804
Link Here
|
799 |
// javac options |
799 |
// javac options |
800 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); |
800 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); |
801 |
} |
801 |
} |
|
|
802 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=300031 |
803 |
public void test020() { |
804 |
Map customOptions = new HashMap(); |
805 |
customOptions.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.ERROR); |
806 |
runNegativeTest( |
807 |
// test directory preparation |
808 |
true /* flush output directory */, |
809 |
new String[] { /* test files */ |
810 |
"a.b.c.d/Deprecated.java", |
811 |
"package a.b.c.d;\n" + |
812 |
"public class Deprecated {\n" + |
813 |
" /** @deprecated */\n" + |
814 |
" public class Inner {\n" + |
815 |
" /** @deprecated */\n" + |
816 |
" public class Inn {\n" + |
817 |
" }\n" + |
818 |
" }\n" + |
819 |
" /** @deprecated */\n" + |
820 |
" public Deprecated foo(){ return null;}\n" + |
821 |
" /** @deprecated */\n" + |
822 |
" public Deprecated goo(){ return null;}\n" + |
823 |
" /** @deprecated */\n" + |
824 |
" public static Deprecated bar(){ return null;}\n" + |
825 |
"}\n", |
826 |
"a.b.c.d.e/T.java", |
827 |
"package a.b.c.d.e;\n" + |
828 |
"import a.b.c.d.Deprecated;\n" + |
829 |
"public class T {\n" + |
830 |
" a.b.c.d.Deprecated f;\n" + |
831 |
" a.b.c.d.Deprecated.Inner.Inn g;\n" + |
832 |
" Deprecated.Inner i;\n" + |
833 |
" public void m() {\n" + |
834 |
" f.foo().goo();\n" + |
835 |
" a.b.c.d.Deprecated.bar();\n" + |
836 |
" }\n" + |
837 |
"}" |
838 |
}, |
839 |
// compiler options |
840 |
null /* no class libraries */, |
841 |
customOptions /* custom options */, |
842 |
// compiler results |
843 |
"----------\n" + /* expected compiler log */ |
844 |
"1. ERROR in a.b.c.d.e\\T.java (at line 5)\n" + |
845 |
" a.b.c.d.Deprecated.Inner.Inn g;\n" + |
846 |
" ^^^^^\n" + |
847 |
"The type Deprecated.Inner is deprecated\n" + |
848 |
"----------\n" + |
849 |
"2. ERROR in a.b.c.d.e\\T.java (at line 5)\n" + |
850 |
" a.b.c.d.Deprecated.Inner.Inn g;\n" + |
851 |
" ^^^\n" + |
852 |
"The type Deprecated.Inner.Inn is deprecated\n" + |
853 |
"----------\n" + |
854 |
"3. ERROR in a.b.c.d.e\\T.java (at line 6)\n" + |
855 |
" Deprecated.Inner i;\n" + |
856 |
" ^^^^^\n" + |
857 |
"The type Deprecated.Inner is deprecated\n" + |
858 |
"----------\n" + |
859 |
"4. ERROR in a.b.c.d.e\\T.java (at line 8)\n" + |
860 |
" f.foo().goo();\n" + |
861 |
" ^^^^^\n" + |
862 |
"The method foo() from the type Deprecated is deprecated\n" + |
863 |
"----------\n" + |
864 |
"5. ERROR in a.b.c.d.e\\T.java (at line 8)\n" + |
865 |
" f.foo().goo();\n" + |
866 |
" ^^^^^\n" + |
867 |
"The method goo() from the type Deprecated is deprecated\n" + |
868 |
"----------\n" + |
869 |
"6. ERROR in a.b.c.d.e\\T.java (at line 9)\n" + |
870 |
" a.b.c.d.Deprecated.bar();\n" + |
871 |
" ^^^^^\n" + |
872 |
"The method bar() from the type Deprecated is deprecated\n" + |
873 |
"----------\n", |
874 |
// javac options |
875 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); |
876 |
} |
802 |
public static Class testClass() { |
877 |
public static Class testClass() { |
803 |
return DeprecatedTest.class; |
878 |
return DeprecatedTest.class; |
804 |
} |
879 |
} |