Lines 618-624
Link Here
|
618 |
result); |
618 |
result); |
619 |
} |
619 |
} |
620 |
// test the tester - runConformTest |
620 |
// test the tester - runConformTest |
621 |
public void _test007(){ |
621 |
public void test007(){ |
622 |
this.runConformTest( |
622 |
this.runConformTest( |
623 |
new String[] { |
623 |
new String[] { |
624 |
"X.java", |
624 |
"X.java", |
Lines 640-659
Link Here
|
640 |
+ " -1.5 -g -preserveAllLocals" |
640 |
+ " -1.5 -g -preserveAllLocals" |
641 |
+ " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar" |
641 |
+ " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar" |
642 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
642 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
643 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
643 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
644 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
644 |
+ " -verbose -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
645 |
"[1 .class file generated]\n", |
645 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
646 |
"----------\n" + |
646 |
"[reading java/lang/Object.class]\n" + |
647 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
647 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
648 |
" (at line 1)\n" + |
648 |
"[reading java/util/List.class]\n" + |
649 |
" import java.util.List;\n" + |
649 |
"[reading java/lang/SuppressWarnings.class]\n" + |
650 |
" ^^^^^^^^^^^^^^\n" + |
650 |
"[reading java/lang/String.class]\n" + |
651 |
"The import java.util.List is never used\n" + |
651 |
"[writing X.class - #1]\n" + |
652 |
"----------\n" + |
652 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
653 |
"1 problem (1 warning)", true); |
653 |
"[1 unit compiled]\n" + |
|
|
654 |
"[1 .class file generated]\n", |
655 |
"", // changed with bug 123522: now the SuppressWarning upon the first type |
656 |
// influences warnings on unused imports |
657 |
true); |
654 |
} |
658 |
} |
655 |
// test the tester - runNegativeTest |
659 |
// test the tester - runNegativeTest |
656 |
public void _test008(){ |
660 |
public void test008(){ |
657 |
this.runNegativeTest( |
661 |
this.runNegativeTest( |
658 |
new String[] { |
662 |
new String[] { |
659 |
"X.java", |
663 |
"X.java", |
Lines 675-683
Link Here
|
675 |
+ " -1.5 -g -preserveAllLocals" |
679 |
+ " -1.5 -g -preserveAllLocals" |
676 |
+ " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar" |
680 |
+ " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar" |
677 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
681 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
678 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
682 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
679 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
683 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
680 |
"[1 .class file generated]\n", |
684 |
"", |
681 |
"----------\n" + |
685 |
"----------\n" + |
682 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
686 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
683 |
" (at line 11)\n" + |
687 |
" (at line 11)\n" + |
Lines 689-695
Link Here
|
689 |
} |
693 |
} |
690 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not |
694 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not |
691 |
// revisit this test case depending on https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349 |
695 |
// revisit this test case depending on https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349 |
692 |
public void _test009(){ |
696 |
public void test009(){ |
693 |
this.runNegativeTest( |
697 |
this.runNegativeTest( |
694 |
new String[] { |
698 |
new String[] { |
695 |
"X.java", |
699 |
"X.java", |
Lines 726-760
Link Here
|
726 |
+ " -1.5 -g -preserveAllLocals" |
730 |
+ " -1.5 -g -preserveAllLocals" |
727 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" |
731 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" |
728 |
+ File.pathSeparator + "-KO]\"" |
732 |
+ File.pathSeparator + "-KO]\"" |
729 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
733 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
730 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
734 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
731 |
"[5 .class files generated]\n", |
735 |
"", |
732 |
"----------\n" + |
736 |
"----------\n" + |
733 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
737 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
734 |
" (at line 5)\n" + |
738 |
" (at line 5)\n" + |
735 |
" Warn warn;\n" + |
739 |
" Warn warn;\n" + |
736 |
" ^^^^\n" + |
740 |
" ^^^^\n" + |
737 |
"Discouraged access: Warn\n" + |
741 |
"Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
738 |
"----------\n" + |
742 |
"----------\n" + |
739 |
"----------\n" + |
743 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
740 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
744 |
" (at line 6)\n" + |
741 |
" (at line 6)\n" + |
745 |
" KO ko;\n" + |
742 |
" KO ko;\n" + |
746 |
" ^^\n" + |
743 |
" ^^\n" + |
747 |
"Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
744 |
"Access restriction: KO\n" + |
748 |
"----------\n" + |
745 |
"----------\n" + |
749 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
746 |
"----------\n" + |
750 |
" (at line 7)\n" + |
747 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
751 |
" Zork z;\n" + |
748 |
" (at line 7)\n" + |
752 |
" ^^^^\n" + |
749 |
" Zork z;\n" + |
753 |
"Zork cannot be resolved to a type\n" + |
750 |
" ^^^^\n" + |
754 |
"----------\n" + |
751 |
"Zork cannot be resolved to a type\n" + |
755 |
"3 problems (1 error, 2 warnings)", |
752 |
"----------\n" + |
|
|
753 |
"3 problems (1 error, 2 warnings)", |
754 |
true); |
756 |
true); |
755 |
} |
757 |
} |
756 |
// command line - no user classpath nor bootclasspath |
758 |
// command line - no user classpath nor bootclasspath |
757 |
public void _test010(){ |
759 |
public void test010(){ |
758 |
this.runConformTest( |
760 |
this.runConformTest( |
759 |
new String[] { |
761 |
new String[] { |
760 |
"X.java", |
762 |
"X.java", |
Lines 776-790
Link Here
|
776 |
+ " -1.5 -g -preserveAllLocals" |
778 |
+ " -1.5 -g -preserveAllLocals" |
777 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
779 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
778 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
780 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
779 |
"[1 .class file generated]\n", |
781 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
780 |
"----------\n" + |
782 |
"[reading java/lang/Object.class]\n" + |
781 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
783 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
782 |
" (at line 1)\n" + |
784 |
"[reading java/util/List.class]\n" + |
783 |
" import java.util.List;\n" + |
785 |
"[reading java/lang/SuppressWarnings.class]\n" + |
784 |
" ^^^^^^^^^^^^^^\n" + |
786 |
"[reading java/lang/String.class]\n" + |
785 |
"The import java.util.List is never used\n" + |
787 |
"[writing X.class - #1]\n" + |
786 |
"----------\n" + |
788 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
787 |
"1 problem (1 warning)", true); |
789 |
"[1 unit compiled]\n" + |
|
|
790 |
"[1 .class file generated]\n", |
791 |
"", |
792 |
true); |
788 |
} |
793 |
} |
789 |
// command line - unusual classpath (ends with ';', still OK) |
794 |
// command line - unusual classpath (ends with ';', still OK) |
790 |
public void test011(){ |
795 |
public void test011(){ |
Lines 805-945
Link Here
|
805 |
true); |
810 |
true); |
806 |
} |
811 |
} |
807 |
// command line - help |
812 |
// command line - help |
808 |
public void _test012(){ |
813 |
public void test012(){ |
809 |
final String expectedOutput = |
814 |
final String expectedOutput = |
810 |
"{0}\n" + |
815 |
"{0}\n" + |
811 |
" \n" + |
816 |
" \n" + |
812 |
" Usage: <options> <source files | directories>\n" + |
817 |
" Usage: <options> <source files | directories>\n" + |
813 |
" If directories are specified, then their source contents are compiled.\n" + |
818 |
" If directories are specified, then their source contents are compiled.\n" + |
814 |
" Possible options are listed below. Options enabled by default are prefixed with \'\'+\'\'\n" + |
819 |
" Possible options are listed below. Options enabled by default are prefixed with ''+''\n" + |
815 |
" \n" + |
820 |
" \n" + |
816 |
" Classpath options:\n" + |
821 |
" Classpath options:\n" + |
817 |
" -cp -classpath <directories and zip/jar files separated by {1}>\n" + |
822 |
" -cp -classpath <directories and zip/jar files separated by :>\n" + |
818 |
" specify location for application classes and sources. Each\n" + |
823 |
" specify location for application classes and sources. Each\n" + |
819 |
" directory or file can specify access rules for types between\n" + |
824 |
" directory or file can specify access rules for types between\n" + |
820 |
" \'\'[\'\' and \'\']\'\' (e.g. [-X.java] to deny access to type X)\n" + |
825 |
" ''['' and '']'' (e.g. [-X] to forbid access to type X, [~X] to\n" + |
821 |
" -bootclasspath <directories and zip/jar files separated by {1}>\n" + |
826 |
" discourage access to type X, [+p/X:-p/*] to forbid access to all\n" + |
822 |
" specify location for system classes. Each directory or file can\n" + |
827 |
" types in package p but allow access to p/X)\n" + |
823 |
" specify access rules for types between \'\'[\'\' and \'\']\'\' (e.g. [-X.java]\n" + |
828 |
" -bootclasspath <directories and zip/jar files separated by :>\n" + |
824 |
" to deny access to type X)\n" + |
829 |
" specify location for system classes. Each directory or file can\n" + |
825 |
" -sourcepath <directories and zip/jar files separated by {1}>\n" + |
830 |
" specify access rules for types between ''['' and '']''\n" + |
826 |
" specify location for application sources. Each directory or file can\n" + |
831 |
" -sourcepath <directories separated by :>\n" + |
827 |
" specify access rules for types between \'\'[\'\' and \'\']\'\' (e.g. [-X.java]\n" + |
832 |
" specify location for application sources. Each directory can\n" + |
828 |
" to deny access to type X)\n" + |
833 |
" specify access rules for types between ''['' and '']''\n" + |
829 |
" -extdirs <directories separated by {1}>\n" + |
834 |
" -extdirs <directories separated by :>\n" + |
830 |
" specify location for extension zip/jar files\n" + |
835 |
" specify location for extension zip/jar files\n" + |
831 |
" -d <dir> destination directory (if omitted, no directory is created)\n" + |
836 |
" -d <dir> destination directory (if omitted, no directory is created)\n" + |
832 |
" -d none generate no .class files\n" + |
837 |
" -d none generate no .class files\n" + |
833 |
" -encoding <enc> specify custom encoding for all sources. Each file/directory can override it\n" + |
838 |
" -encoding <enc> specify custom encoding for all sources. Each file/directory can override it\n" + |
834 |
" when suffixed with \'\'[\'\'<enc>\'\']\'\' (e.g. X.java[utf8])\n" + |
839 |
" when suffixed with ''[''<enc>'']'' (e.g. X.java[utf8])\n" + |
835 |
" \n" + |
840 |
" \n" + |
836 |
" Compliance options:\n" + |
841 |
" Compliance options:\n" + |
837 |
" -1.3 use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n" + |
842 |
" -1.3 use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n" + |
838 |
" -1.4 + use 1.4 compliance level (implicit -source 1.3 -target 1.2)\n" + |
843 |
" -1.4 + use 1.4 compliance level (implicit -source 1.3 -target 1.2)\n" + |
839 |
" -1.5 use 1.5 compliance level (implicit -source 1.5 -target 1.5)\n" + |
844 |
" -1.5 use 1.5 compliance level (implicit -source 1.5 -target 1.5)\n" + |
840 |
" -source <version> set source level: 1.3 to 1.5 (or 5 or 5.0)\n" + |
845 |
" -1.6 use 1.6 compliance level (implicit -source 1.6 -target 1.6)\n" + |
841 |
" -target <version> set classfile target level: 1.1 to 1.5 (or 5 or 5.0)\n" + |
846 |
" -source <version> set source level: 1.3 to 1.6 (or 6 or 6.0)\n" + |
842 |
" \n" + |
847 |
" -target <version> set classfile target level: 1.1 to 1.6 (or 6 or 6.0)\n" + |
843 |
" Warning options:\n" + |
848 |
" \n" + |
844 |
" -deprecation + deprecation outside deprecated code\n" + |
849 |
" Warning options:\n" + |
845 |
" -nowarn disable all warnings\n" + |
850 |
" -deprecation + deprecation outside deprecated code\n" + |
846 |
" -warn:none disable all warnings\n" + |
851 |
" -nowarn disable all warnings\n" + |
847 |
" -warn:<warnings separated by ,> enable exactly the listed warnings\n" + |
852 |
" -warn:none disable all warnings\n" + |
848 |
" -warn:+<warnings separated by ,> enable additional warnings\n" + |
853 |
" -warn:<warnings separated by ,> enable exactly the listed warnings\n" + |
849 |
" -warn:-<warnings separated by ,> disable specific warnings\n" + |
854 |
" -warn:+<warnings separated by ,> enable additional warnings\n" + |
850 |
" allDeprecation deprecation including inside deprecated code\n" + |
855 |
" -warn:-<warnings separated by ,> disable specific warnings\n" + |
851 |
" allJavadoc invalid or missing javadoc\n" + |
856 |
" allDeprecation deprecation including inside deprecated code\n" + |
852 |
" assertIdentifier + \'\'assert\'\' used as identifier\n" + |
857 |
" allJavadoc invalid or missing javadoc\n" + |
853 |
" boxing autoboxing conversion\n" + |
858 |
" assertIdentifier + ''assert'' used as identifier\n" + |
854 |
" charConcat + char[] in String concat\n" + |
859 |
" boxing autoboxing conversion\n" + |
855 |
" conditionAssign possible accidental boolean assignment\n" + |
860 |
" charConcat + char[] in String concat\n" + |
856 |
" constructorName + method with constructor name\n" + |
861 |
" conditionAssign possible accidental boolean assignment\n" + |
857 |
" dep-ann missing @Deprecated annotation\n" + |
862 |
" constructorName + method with constructor name\n" + |
858 |
" deprecation + deprecation outside deprecated code\n" + |
863 |
" dep-ann missing @Deprecated annotation\n" + |
859 |
" emptyBlock undocumented empty block\n" + |
864 |
" deprecation + deprecation outside deprecated code\n" + |
860 |
" enumSwitch incomplete enum switch\n" + |
865 |
" discouraged + use of types matching a discouraged access rule\n" + |
861 |
" fieldHiding field hiding another variable\n" + |
866 |
" emptyBlock undocumented empty block\n" + |
862 |
" finalBound type parameter with final bound\n" + |
867 |
" enumSwitch incomplete enum switch\n" + |
863 |
" finally + finally block not completing normally\n" + |
868 |
" fieldHiding field hiding another variable\n" + |
864 |
" indirectStatic indirect reference to static member\n" + |
869 |
" finalBound type parameter with final bound\n" + |
865 |
" intfAnnotation + annotation type used as super interface\n" + |
870 |
" finally + finally block not completing normally\n" + |
866 |
" intfNonInherited + interface non-inherited method compatibility\n" + |
871 |
" forbidden + use of types matching a forbidden access rule\n" + |
867 |
" javadoc invalid javadoc\n" + |
872 |
" hiding macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock\n" + |
868 |
" localHiding local variable hiding another variable\n" + |
873 |
" incomplete-switch same as enumSwitch\n" + |
869 |
" maskedCatchBlock + hidden catch block\n" + |
874 |
" indirectStatic indirect reference to static member\n" + |
870 |
" nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" + |
875 |
" intfAnnotation + annotation type used as super interface\n" + |
871 |
" noEffectAssign + assignment without effect\n" + |
876 |
" intfNonInherited + interface non-inherited method compatibility\n" + |
872 |
" null missing or redundant null check\n" + |
877 |
" javadoc invalid javadoc\n" + |
873 |
" over-ann missing @Override annotation\n" + |
878 |
" localHiding local variable hiding another variable\n" + |
874 |
" pkgDefaultMethod + attempt to override package-default method\n" + |
879 |
" maskedCatchBlock + hidden catch block\n" + |
875 |
" semicolon unnecessary semicolon, empty statement\n" + |
880 |
" nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" + |
876 |
" serial + missing serialVersionUID\n" + |
881 |
" noEffectAssign + assignment without effect\n" + |
877 |
" suppress + enable @SuppressWarnings\n" + |
882 |
" null missing or redundant null check\n" + |
878 |
" unqualifiedField unqualified reference to field\n" + |
883 |
" over-ann missing @Override annotation\n" + |
879 |
" unchecked + unchecked type operation\n" + |
884 |
" paramAssign assignment to a parameter\n" + |
880 |
" unusedArgument unread method parameter\n" + |
885 |
" pkgDefaultMethod + attempt to override package-default method\n" + |
881 |
" unusedImport + unused import declaration\n" + |
886 |
" raw usage of raw type\n" + |
882 |
" unusedLocal unread local variable\n" + |
887 |
" semicolon unnecessary semicolon, empty statement\n" + |
883 |
" unusedPrivate unused private member declaration\n" + |
888 |
" serial + missing serialVersionUID\n" + |
884 |
" unusedThrown unused declared thrown exception\n" + |
889 |
" specialParamHiding constructor or setter parameter hiding another field\n" + |
885 |
" unnecessaryElse unnecessary else clause\n" + |
890 |
" static-access macro for indirectStatic and staticReceiver\n" + |
886 |
" uselessTypeCheck unnecessary cast/instanceof operation\n" + |
891 |
" staticReceiver + non-static reference to static member\n" + |
887 |
" specialParamHiding constructor or setter parameter hiding another field\n" + |
892 |
" suppress + enable @SuppressWarnings\n" + |
888 |
" staticReceiver + non-static reference to static member\n" + |
893 |
" synthetic-access same as syntheticAccess\n" + |
889 |
" syntheticAccess synthetic access for innerclass\n" + |
894 |
" syntheticAccess synthetic access for innerclass\n" + |
890 |
" tasks(<tags separated by |>) tasks identified by tags inside comments\n" + |
895 |
" tasks(<tags separated by |>) tasks identified by tags inside comments\n" + |
891 |
" typeHiding + type parameter hiding another type\n" + |
896 |
" typeHiding + type parameter hiding another type\n" + |
892 |
" varargsCast + varargs argument need explicit cast\n" + |
897 |
" unchecked + unchecked type operation\n" + |
893 |
" warningToken + unhandled warning token in @SuppressWarnings\n" + |
898 |
" unnecessaryElse unnecessary else clause\n" + |
894 |
" \n" + |
899 |
" unqualified-field-access same as unQualifiedField\n" + |
895 |
" Debug options:\n" + |
900 |
" unqualifiedField unqualified reference to field\n" + |
896 |
" -g[:lines,vars,source] custom debug info\n" + |
901 |
" unused macro for unusedArgument, unusedImport, unusedLabel,\n" + |
897 |
" -g:lines,source + both lines table and source debug info\n" + |
902 |
" unusedLocal, unusedPrivate and unusedThrown\n" + |
898 |
" -g all debug info\n" + |
903 |
" unusedArgument unread method parameter\n" + |
899 |
" -g:none no debug info\n" + |
904 |
" unusedImport + unused import declaration\n" + |
900 |
" -preserveAllLocals preserve unused local vars for debug purpose\n" + |
905 |
" unusedLabel + unused label\n" + |
901 |
" \n" + |
906 |
" unusedLocal + unread local variable\n" + |
902 |
" Ignored options:\n" + |
907 |
" unusedPrivate + unused private member declaration\n" + |
903 |
" -J<option> pass option to virtual machine (ignored)\n" + |
908 |
" unusedThrown unused declared thrown exception\n" + |
904 |
" -X<option> specify non-standard option (ignored)\n" + |
909 |
" uselessTypeCheck unnecessary cast/instanceof operation\n" + |
905 |
" -X print non-standard options and exit (ignored)\n" + |
910 |
" varargsCast + varargs argument need explicit cast\n" + |
906 |
" -O optimize for execution time (ignored)\n" + |
911 |
" warningToken + unhandled warning token in @SuppressWarnings\n" + |
907 |
" \n" + |
912 |
" \n" + |
908 |
" Advanced options:\n" + |
913 |
" Debug options:\n" + |
909 |
" @<file> read command line arguments from file\n" + |
914 |
" -g[:lines,vars,source] custom debug info\n" + |
910 |
" -maxProblems <n> max number of problems per compilation unit (100 by default)\n" + |
915 |
" -g:lines,source + both lines table and source debug info\n" + |
911 |
" -log <file> log to a file\n" + |
916 |
" -g all debug info\n" + |
912 |
" -proceedOnError do not stop at first error, dumping class files with problem methods\n" + |
917 |
" -g:none no debug info\n" + |
913 |
" -verbose enable verbose output\n" + |
918 |
" -preserveAllLocals preserve unused local vars for debug purpose\n" + |
914 |
" -referenceInfo compute reference info\n" + |
919 |
" \n" + |
915 |
" -progress show progress (only in -log mode)\n" + |
920 |
" Ignored options:\n" + |
916 |
" -time display speed information \n" + |
921 |
" -J<option> pass option to virtual machine (ignored)\n" + |
917 |
" -noExit do not call System.exit(n) at end of compilation (n==0 if no error)\n" + |
922 |
" -X<option> specify non-standard option (ignored)\n" + |
918 |
" -repeat <n> repeat compilation process <n> times for perf analysis\n" + |
923 |
" -X print non-standard options and exit (ignored)\n" + |
919 |
" -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n" + |
924 |
" -O optimize for execution time (ignored)\n" + |
920 |
" -enableJavadoc consider references in javadoc\n" + |
925 |
" \n" + |
921 |
" \n" + |
926 |
" Advanced options:\n" + |
922 |
" -? -help print this help message\n" + |
927 |
" @<file> read command line arguments from file\n" + |
923 |
" -v -version print compiler version\n" + |
928 |
" -maxProblems <n> max number of problems per compilation unit (100 by default)\n" + |
924 |
" -showversion print compiler version and continue\n" + |
929 |
" -log <file> log to a file. If the file extension is ''.xml'', then the log\n" + |
925 |
"\n"; |
930 |
" will be a xml file.\n" + |
|
|
931 |
" -proceedOnError do not stop at first error, dumping class files with problem methods\n" + |
932 |
" -verbose enable verbose output\n" + |
933 |
" -referenceInfo compute reference info\n" + |
934 |
" -progress show progress (only in -log mode)\n" + |
935 |
" -time display speed information \n" + |
936 |
" -noExit do not call System.exit(n) at end of compilation (n==0 if no error)\n" + |
937 |
" -repeat <n> repeat compilation process <n> times for perf analysis\n" + |
938 |
" -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n" + |
939 |
" -enableJavadoc consider references in javadoc\n" + |
940 |
" \n" + |
941 |
" -? -help print this help message\n" + |
942 |
" -v -version print compiler version\n" + |
943 |
" -showversion print compiler version and continue\n" + |
944 |
"\n"; |
926 |
|
945 |
|
927 |
this.runConformTest( |
946 |
this.runConformTest( |
928 |
new String[0], |
947 |
new String[0], |
929 |
" -help -showversion -referenceInfo", |
948 |
" -help -referenceInfo", |
930 |
MessageFormat.format(expectedOutput, new String[] { |
949 |
MessageFormat.format(expectedOutput, new String[] { |
931 |
Main.bind("misc.version", new String[] { |
950 |
Main.bind("misc.version", new String[] { |
932 |
Main.bind("compiler.name"), |
951 |
Main.bind("compiler.name"), |
933 |
Main.bind("compiler.version"), |
952 |
Main.bind("compiler.version"), |
934 |
Main.bind("compiler.copyright") |
953 |
Main.bind("compiler.copyright") |
935 |
}), |
954 |
}), |
936 |
File.pathSeparator |
955 |
// File.pathSeparator |
937 |
}), |
956 |
}), |
938 |
"", true); |
957 |
"", true); |
939 |
} |
958 |
} |
940 |
|
959 |
|
941 |
// command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
960 |
// command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
942 |
public void _test013() { |
961 |
public void test013() { |
943 |
String logFileName = OUTPUT_DIR + File.separator + "log.xml"; |
962 |
String logFileName = OUTPUT_DIR + File.separator + "log.xml"; |
944 |
this.runNegativeTest(new String[] { |
963 |
this.runNegativeTest(new String[] { |
945 |
"X.java", |
964 |
"X.java", |
Lines 963-970
Link Here
|
963 |
String logContents = Util.fileContent(logFileName); |
982 |
String logContents = Util.fileContent(logFileName); |
964 |
String expectedLogContents = |
983 |
String expectedLogContents = |
965 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
984 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
966 |
"<!DOCTYPE compiler SYSTEM \"compiler.dtd\">\n" + |
985 |
"<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.001 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_001.dtd\">\n" + |
967 |
"<compiler name=\"Eclipse Java Compiler\" copyright=\"Copyright IBM Corp 2000, 2005. All rights reserved.\" version=\"{1}\">\n" + |
986 |
"<compiler name=\"{1}\" copyright=\"{2}\" version=\"{3}\">\n" + |
968 |
" <command_line>\n" + |
987 |
" <command_line>\n" + |
969 |
" <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + |
988 |
" <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + |
970 |
" <argument value=\"-1.5\"/>\n" + |
989 |
" <argument value=\"-1.5\"/>\n" + |
Lines 993-998
Link Here
|
993 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + |
1012 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + |
994 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" + |
1013 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" + |
995 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + |
1014 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + |
|
|
1015 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.fatalOptionalError\" value=\"enabled\"/>\n" + |
996 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" + |
1016 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" + |
997 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" + |
1017 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" + |
998 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + |
1018 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + |
Lines 1002-1011
Link Here
|
1002 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + |
1022 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + |
1003 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + |
1023 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + |
1004 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" + |
1024 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" + |
1005 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"enabled\"/>\n" + |
1025 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"disabled\"/>\n" + |
1006 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"enabled\"/>\n" + |
1026 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"disabled\"/>\n" + |
1007 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"enabled\"/>\n" + |
1027 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"disabled\"/>\n" + |
1008 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"private\"/>\n" + |
1028 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"public\"/>\n" + |
1009 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" + |
1029 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" + |
1010 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" + |
1030 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" + |
1011 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation\" value=\"ignore\"/>\n" + |
1031 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation\" value=\"ignore\"/>\n" + |
Lines 1014-1020
Link Here
|
1014 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" + |
1034 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" + |
1015 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" + |
1035 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" + |
1016 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" + |
1036 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" + |
1017 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"private\"/>\n" + |
1037 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" + |
1018 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" + |
1038 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" + |
1019 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" + |
1039 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" + |
1020 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" + |
1040 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" + |
Lines 1022-1028
Link Here
|
1022 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" + |
1042 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" + |
1023 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"ignore\"/>\n" + |
1043 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"ignore\"/>\n" + |
1024 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + |
1044 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + |
|
|
1045 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" + |
1025 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + |
1046 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + |
|
|
1047 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"ignore\"/>\n" + |
1026 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + |
1048 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + |
1027 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + |
1049 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + |
1028 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + |
1050 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + |
Lines 1037-1047
Link Here
|
1037 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" + |
1059 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" + |
1038 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" + |
1060 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" + |
1039 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" + |
1061 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" + |
1040 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"ignore\"/>\n" + |
1062 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" + |
|
|
1063 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"warning\"/>\n" + |
1041 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" + |
1064 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" + |
1042 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" + |
1065 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" + |
1043 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" + |
1066 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" + |
1044 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"ignore\"/>\n" + |
1067 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"warning\"/>\n" + |
1045 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" + |
1068 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" + |
1046 |
" <option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" + |
1069 |
" <option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" + |
1047 |
" <option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" + |
1070 |
" <option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" + |
Lines 1067-1080
Link Here
|
1067 |
" <problem_summary problems=\"1\" errors=\"1\" warnings=\"0\" tasks=\"0\"/>\n" + |
1090 |
" <problem_summary problems=\"1\" errors=\"1\" warnings=\"0\" tasks=\"0\"/>\n" + |
1068 |
" </stats>\n" + |
1091 |
" </stats>\n" + |
1069 |
"</compiler>\n"; |
1092 |
"</compiler>\n"; |
1070 |
boolean compareOK = semiNormalizedComparison( |
1093 |
String normalizedExpectedLogContents = |
1071 |
MessageFormat.format( |
1094 |
MessageFormat.format( |
1072 |
expectedLogContents, |
1095 |
expectedLogContents, |
1073 |
new String[] { |
1096 |
new String[] { |
1074 |
File.separator, |
1097 |
File.separator, |
|
|
1098 |
Main.bind("compiler.name"), |
1099 |
Main.bind("compiler.copyright"), |
1075 |
Main.bind("compiler.version") |
1100 |
Main.bind("compiler.version") |
1076 |
}), |
1101 |
}); |
1077 |
logContents, xmlLogsNormalizer); |
1102 |
String normalizedLogContents = |
|
|
1103 |
xmlLogsNormalizer.normalized(logContents); |
1104 |
boolean compareOK = normalizedExpectedLogContents.equals( |
1105 |
normalizedLogContents); |
1078 |
if (!compareOK) { |
1106 |
if (!compareOK) { |
1079 |
System.out.println(getClass().getName() + '#' + getName()); |
1107 |
System.out.println(getClass().getName() + '#' + getName()); |
1080 |
System.out.println( |
1108 |
System.out.println( |
Lines 1086-1093
Link Here
|
1086 |
+ "\n--------- (cut and paste:) ----------\n" |
1114 |
+ "\n--------- (cut and paste:) ----------\n" |
1087 |
+ Util.displayString(xmlLogsNormalizer.normalized(logContents)) |
1115 |
+ Util.displayString(xmlLogsNormalizer.normalized(logContents)) |
1088 |
+ "\n------------- [END LOG] -------------\n"); |
1116 |
+ "\n------------- [END LOG] -------------\n"); |
|
|
1117 |
assertEquals("Unexpected log contents", |
1118 |
normalizedExpectedLogContents, normalizedLogContents); |
1089 |
} |
1119 |
} |
1090 |
assertTrue("unexpected log contents", compareOK); |
|
|
1091 |
} |
1120 |
} |
1092 |
|
1121 |
|
1093 |
// command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
1122 |
// command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
Lines 1187-1193
Link Here
|
1187 |
} |
1216 |
} |
1188 |
assertTrue("unexpected log contents", compareOK); |
1217 |
assertTrue("unexpected log contents", compareOK); |
1189 |
} |
1218 |
} |
1190 |
public void _test016(){ |
1219 |
public void test016(){ |
1191 |
this.runConformTest( |
1220 |
this.runConformTest( |
1192 |
new String[] { |
1221 |
new String[] { |
1193 |
"X.java", |
1222 |
"X.java", |
Lines 1206-1216
Link Here
|
1206 |
+ " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1235 |
+ " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1207 |
+ " -verbose -proceedOnError -referenceInfo" |
1236 |
+ " -verbose -proceedOnError -referenceInfo" |
1208 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1237 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1209 |
"[2 .class files generated]\n", |
1238 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
|
|
1239 |
"[reading java/lang/Object.class]\n" + |
1240 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1241 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + |
1242 |
"[writing X.class - #1]\n" + |
1243 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/2]\n" + |
1244 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + |
1245 |
"[writing OK1.class - #2]\n" + |
1246 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + |
1247 |
"[2 units compiled]\n" + |
1248 |
"[2 .class files generated]\n", |
1210 |
"", |
1249 |
"", |
1211 |
true); |
1250 |
true); |
1212 |
} |
1251 |
} |
1213 |
public void _test017(){ |
1252 |
public void test017(){ |
1214 |
this.runConformTest( |
1253 |
this.runConformTest( |
1215 |
new String[] { |
1254 |
new String[] { |
1216 |
"X.java", |
1255 |
"X.java", |
Lines 1227-1242
Link Here
|
1227 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1266 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1228 |
+ " -1.5 -g -preserveAllLocals" |
1267 |
+ " -1.5 -g -preserveAllLocals" |
1229 |
+ " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1268 |
+ " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1230 |
+ " -verbose -proceedOnError -referenceInfo" |
1269 |
+ " -proceedOnError -referenceInfo" |
1231 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1270 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1232 |
"[2 .class files generated]\n", |
1271 |
"", |
1233 |
"incorrect classpath: dummmy_dir\n" + |
1272 |
"incorrect classpath: dummmy_dir\n", |
1234 |
"incorrect classpath: dummy.jar\n" + |
|
|
1235 |
"incorrect classpath: dummy.jar\n", |
1236 |
true); |
1273 |
true); |
1237 |
} |
1274 |
} |
|
|
1275 |
// we tolerate inexisting jars on the classpath |
1276 |
// TODO (maxime) check and document |
1277 |
public void _test017b(){ |
1278 |
this.runConformTest( |
1279 |
new String[] { |
1280 |
"X.java", |
1281 |
"/** */\n" + |
1282 |
"public class X {\n" + |
1283 |
" OK1 ok1;\n" + |
1284 |
"}", |
1285 |
"OK1.java", |
1286 |
"/** */\n" + |
1287 |
"public class OK1 {\n" + |
1288 |
" // empty\n" + |
1289 |
"}" |
1290 |
}, |
1291 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1292 |
+ " -1.5 -g -preserveAllLocals" |
1293 |
+ " -cp dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1294 |
+ " -verbose -proceedOnError -referenceInfo" |
1295 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1296 |
"[2 .class files generated]\n", |
1297 |
"incorrect classpath: dummmy.jar\n", |
1298 |
true); |
1299 |
} |
1300 |
// we tolerate empty classpath entries |
1301 |
// TODO (maxime) check and document |
1302 |
public void _test017c(){ |
1303 |
this.runConformTest( |
1304 |
new String[] { |
1305 |
"X.java", |
1306 |
"/** */\n" + |
1307 |
"public class X {\n" + |
1308 |
" OK1 ok1;\n" + |
1309 |
"}", |
1310 |
"OK1.java", |
1311 |
"/** */\n" + |
1312 |
"public class OK1 {\n" + |
1313 |
" // empty\n" + |
1314 |
"}" |
1315 |
}, |
1316 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1317 |
+ " -1.5 -g -preserveAllLocals" |
1318 |
+ " -cp " + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1319 |
+ " -verbose -proceedOnError -referenceInfo" |
1320 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1321 |
"[2 .class files generated]\n", |
1322 |
"incorrect classpath\n", |
1323 |
true); |
1324 |
} |
1238 |
// command line - unusual classpath (empty, but using current directory, still OK provided |
1325 |
// command line - unusual classpath (empty, but using current directory, still OK provided |
1239 |
// that we execute from the appropriate directory) |
1326 |
// that we execute from the appropriate directory); since there is no notion |
|
|
1327 |
// of current directory for this tests suite, the test is not executed |
1328 |
// TODO (maxime) enforce working directory |
1240 |
public void _test018(){ |
1329 |
public void _test018(){ |
1241 |
this.runConformTest( |
1330 |
this.runConformTest( |
1242 |
new String[] { |
1331 |
new String[] { |
Lines 1259-1265
Link Here
|
1259 |
"", |
1348 |
"", |
1260 |
true); |
1349 |
true); |
1261 |
} |
1350 |
} |
1262 |
public void _test019(){ |
1351 |
public void test019(){ |
1263 |
this.runNegativeTest( |
1352 |
this.runNegativeTest( |
1264 |
new String[] { |
1353 |
new String[] { |
1265 |
"X.java", |
1354 |
"X.java", |
Lines 1295-1330
Link Here
|
1295 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1384 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1296 |
+ " -1.5 -g -preserveAllLocals" |
1385 |
+ " -1.5 -g -preserveAllLocals" |
1297 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\"" |
1386 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\"" |
1298 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
1387 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
1299 |
+ " -proceedOnError -referenceInfo" |
1388 |
+ " -proceedOnError -referenceInfo" |
1300 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1389 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1301 |
"[5 .class files generated]\n", |
1390 |
"", |
1302 |
"----------\n" + |
1391 |
"----------\n" + |
1303 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1392 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1304 |
" (at line 5)\n" + |
1393 |
" (at line 5)\n" + |
1305 |
" Warn warn;\n" + |
1394 |
" Warn warn;\n" + |
1306 |
" ^^^^\n" + |
1395 |
" ^^^^\n" + |
1307 |
"Discouraged access: Warn\n" + |
1396 |
"Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
1308 |
"----------\n" + |
1397 |
"----------\n" + |
1309 |
"----------\n" + |
1398 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1310 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1399 |
" (at line 6)\n" + |
1311 |
" (at line 6)\n" + |
1400 |
" KO ko;\n" + |
1312 |
" KO ko;\n" + |
1401 |
" ^^\n" + |
1313 |
" ^^\n" + |
1402 |
"Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + |
1314 |
"Access restriction: KO\n" + |
1403 |
"----------\n" + |
1315 |
"----------\n" + |
1404 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1316 |
"----------\n" + |
1405 |
" (at line 7)\n" + |
1317 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1406 |
" Zork z;\n" + |
1318 |
" (at line 7)\n" + |
1407 |
" ^^^^\n" + |
1319 |
" Zork z;\n" + |
1408 |
"Zork cannot be resolved to a type\n" + |
1320 |
" ^^^^\n" + |
1409 |
"----------\n" + |
1321 |
"Zork cannot be resolved to a type\n" + |
1410 |
"3 problems (1 error, 2 warnings)", |
1322 |
"----------\n" + |
|
|
1323 |
"3 problems (1 error, 2 warnings)", |
1324 |
true); |
1411 |
true); |
1325 |
} |
1412 |
} |
1326 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed |
1413 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed |
1327 |
public void _test020(){ |
1414 |
public void test020(){ |
1328 |
this.runConformTest( |
1415 |
this.runConformTest( |
1329 |
new String[] { |
1416 |
new String[] { |
1330 |
"X.java", |
1417 |
"X.java", |
Lines 1336-1347
Link Here
|
1336 |
+ " -1.5 -g -preserveAllLocals" |
1423 |
+ " -1.5 -g -preserveAllLocals" |
1337 |
+ " -verbose -proceedOnError -referenceInfo" |
1424 |
+ " -verbose -proceedOnError -referenceInfo" |
1338 |
+ " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu", |
1425 |
+ " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu", |
1339 |
"[1 .class file generated]\n", |
1426 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
|
|
1427 |
"[reading java/lang/Object.class]\n" + |
1428 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1429 |
"[writing X.class - #1]\n" + |
1430 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1431 |
"[1 unit compiled]\n" + |
1432 |
"[1 .class file generated]\n", |
1340 |
"", |
1433 |
"", |
1341 |
true); |
1434 |
true); |
1342 |
} |
1435 |
} |
1343 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files |
1436 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files |
1344 |
public void _test021(){ |
1437 |
public void test021(){ |
1345 |
this.runConformTest( |
1438 |
this.runConformTest( |
1346 |
new String[] { |
1439 |
new String[] { |
1347 |
"src1/X.java", |
1440 |
"src1/X.java", |
Lines 1359-1365
Link Here
|
1359 |
+ " -1.5 -g -preserveAllLocals" |
1452 |
+ " -1.5 -g -preserveAllLocals" |
1360 |
+ " -verbose -proceedOnError -referenceInfo" |
1453 |
+ " -verbose -proceedOnError -referenceInfo" |
1361 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1454 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1362 |
"[2 .class files generated]\n", |
1455 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + |
|
|
1456 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1457 |
"[reading java/lang/Object.class]\n" + |
1458 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1459 |
"[writing Y.class - #1]\n" + |
1460 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1461 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1462 |
"[writing X.class - #2]\n" + |
1463 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1464 |
"[2 units compiled]\n" + |
1465 |
"[2 .class files generated]\n", |
1363 |
"", |
1466 |
"", |
1364 |
true); |
1467 |
true); |
1365 |
} |
1468 |
} |
Lines 1411-1417
Link Here
|
1411 |
true); |
1514 |
true); |
1412 |
} |
1515 |
} |
1413 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions |
1516 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions |
1414 |
public void _test024(){ |
1517 |
public void test024(){ |
1415 |
this.runNegativeTest( |
1518 |
this.runNegativeTest( |
1416 |
new String[] { |
1519 |
new String[] { |
1417 |
"X.java", |
1520 |
"X.java", |
Lines 1423-1431
Link Here
|
1423 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1526 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1424 |
+ " -extdirs \"\"" |
1527 |
+ " -extdirs \"\"" |
1425 |
+ " -1.5 -g -preserveAllLocals" |
1528 |
+ " -1.5 -g -preserveAllLocals" |
1426 |
+ " -verbose -proceedOnError -referenceInfo" |
1529 |
+ " -proceedOnError -referenceInfo" |
1427 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1530 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1428 |
"[1 .class file generated]\n", |
1531 |
"", |
1429 |
"----------\n" + |
1532 |
"----------\n" + |
1430 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1533 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1431 |
" (at line 3)\n" + |
1534 |
" (at line 3)\n" + |
Lines 1437-1443
Link Here
|
1437 |
true); |
1540 |
true); |
1438 |
} |
1541 |
} |
1439 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath |
1542 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath |
1440 |
public void _test025(){ |
1543 |
public void test025(){ |
1441 |
this.runConformTest( |
1544 |
this.runConformTest( |
1442 |
new String[] { |
1545 |
new String[] { |
1443 |
"src1/X.java", |
1546 |
"src1/X.java", |
Lines 1456-1467
Link Here
|
1456 |
+ " -1.5 -g -preserveAllLocals" |
1559 |
+ " -1.5 -g -preserveAllLocals" |
1457 |
+ " -verbose -proceedOnError -referenceInfo" |
1560 |
+ " -verbose -proceedOnError -referenceInfo" |
1458 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1561 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1459 |
"[2 .class files generated]\n", |
1562 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + |
|
|
1563 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1564 |
"[reading java/lang/Object.class]\n" + |
1565 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1566 |
"[writing Y.class - #1]\n" + |
1567 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1568 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1569 |
"[reading sun/net/spi/nameservice/dns/DNSNameService.class]\n" + |
1570 |
"[writing X.class - #2]\n" + |
1571 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1572 |
"[2 units compiled]\n" + |
1573 |
"[2 .class files generated]\n", |
1460 |
"", |
1574 |
"", |
1461 |
true); |
1575 |
true); |
1462 |
} |
1576 |
} |
1463 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath |
1577 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath |
1464 |
public void _test026(){ |
1578 |
public void test026(){ |
1465 |
this.runConformTest( |
1579 |
this.runConformTest( |
1466 |
new String[] { |
1580 |
new String[] { |
1467 |
"src1/X.java", |
1581 |
"src1/X.java", |
Lines 1485-1491
Link Here
|
1485 |
+ " -1.5 -g -preserveAllLocals" |
1599 |
+ " -1.5 -g -preserveAllLocals" |
1486 |
+ " -verbose -proceedOnError -referenceInfo" |
1600 |
+ " -verbose -proceedOnError -referenceInfo" |
1487 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1601 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1488 |
"[2 .class files generated]\n", |
1602 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + |
|
|
1603 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1604 |
"[reading java/lang/Object.class]\n" + |
1605 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1606 |
"[writing Y.class - #1]\n" + |
1607 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1608 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1609 |
"[writing X.class - #2]\n" + |
1610 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1611 |
"[2 units compiled]\n" + |
1612 |
"[2 .class files generated]\n", |
1489 |
"", |
1613 |
"", |
1490 |
true); |
1614 |
true); |
1491 |
} |
1615 |
} |