Lines 482-488
Link Here
|
482 |
if (normalize == null) |
482 |
if (normalize == null) |
483 |
return false; |
483 |
return false; |
484 |
// return keep.equals(normalizer.normalized(normalize)); |
484 |
// return keep.equals(normalizer.normalized(normalize)); |
485 |
return equals(keep, normalizer.normalized(normalize)); |
485 |
return equals(keep, |
|
|
486 |
normalizer.normalized(normalize)); |
486 |
} |
487 |
} |
487 |
private static boolean equals(String a, String b) { |
488 |
private static boolean equals(String a, String b) { |
488 |
StringBuffer aBuffer = new StringBuffer(a), bBuffer = new StringBuffer(b); |
489 |
StringBuffer aBuffer = new StringBuffer(a), bBuffer = new StringBuffer(b); |
Lines 618-624
Link Here
|
618 |
result); |
619 |
result); |
619 |
} |
620 |
} |
620 |
// test the tester - runConformTest |
621 |
// test the tester - runConformTest |
621 |
public void _test007(){ |
622 |
public void test007(){ |
622 |
this.runConformTest( |
623 |
this.runConformTest( |
623 |
new String[] { |
624 |
new String[] { |
624 |
"X.java", |
625 |
"X.java", |
Lines 642-650
Link Here
|
642 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
643 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
643 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
644 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
644 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
645 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
645 |
"[1 .class file generated]\n", |
646 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
|
|
647 |
"[reading java/lang/Object.class]\n" + |
648 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
649 |
"[reading java/util/List.class]\n" + |
650 |
"[reading java/lang/SuppressWarnings.class]\n" + |
651 |
"[reading java/lang/String.class]\n" + |
652 |
"[writing X.class - #1]\n" + |
653 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
654 |
"[1 unit compiled]\n" + |
655 |
"[1 .class file generated]\n", |
646 |
"----------\n" + |
656 |
"----------\n" + |
647 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
657 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
648 |
" (at line 1)\n" + |
658 |
" (at line 1)\n" + |
649 |
" import java.util.List;\n" + |
659 |
" import java.util.List;\n" + |
650 |
" ^^^^^^^^^^^^^^\n" + |
660 |
" ^^^^^^^^^^^^^^\n" + |
Lines 653-659
Link Here
|
653 |
"1 problem (1 warning)", true); |
663 |
"1 problem (1 warning)", true); |
654 |
} |
664 |
} |
655 |
// test the tester - runNegativeTest |
665 |
// test the tester - runNegativeTest |
656 |
public void _test008(){ |
666 |
public void test008(){ |
657 |
this.runNegativeTest( |
667 |
this.runNegativeTest( |
658 |
new String[] { |
668 |
new String[] { |
659 |
"X.java", |
669 |
"X.java", |
Lines 677-695
Link Here
|
677 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
687 |
+ " -cp " + JRE_HOME_DIR + "/lib/jce.jar" |
678 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
688 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
679 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
689 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
680 |
"[1 .class file generated]\n", |
690 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
681 |
"----------\n" + |
691 |
"[reading java/lang/Object.class]\n" + |
682 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
692 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
683 |
" (at line 11)\n" + |
693 |
"[reading java/util/List.class]\n" + |
684 |
" Zork z;\n" + |
694 |
"[reading java/lang/SuppressWarnings.class]\n" + |
685 |
" ^^^^\n" + |
695 |
"[reading java/lang/String.class]\n" + |
686 |
"Zork cannot be resolved to a type\n" + |
696 |
"[writing X.class - #1]\n" + |
687 |
"----------\n" + |
697 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
688 |
"1 problem (1 error)", true); |
698 |
"[1 unit compiled]\n" + |
|
|
699 |
"[1 .class file generated]\n", |
700 |
"----------\n" + |
701 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
702 |
" (at line 11)\n" + |
703 |
" Zork z;\n" + |
704 |
" ^^^^\n" + |
705 |
"Zork cannot be resolved to a type\n" + |
706 |
"----------\n" + |
707 |
"1 problem (1 error)", |
708 |
true); |
689 |
} |
709 |
} |
690 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not |
710 |
// 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 |
711 |
// revisit this test case depending on https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349 |
692 |
public void _test009(){ |
712 |
public void test009(){ |
693 |
this.runNegativeTest( |
713 |
this.runNegativeTest( |
694 |
new String[] { |
714 |
new String[] { |
695 |
"X.java", |
715 |
"X.java", |
Lines 726-760
Link Here
|
726 |
+ " -1.5 -g -preserveAllLocals" |
746 |
+ " -1.5 -g -preserveAllLocals" |
727 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" |
747 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" |
728 |
+ File.pathSeparator + "-KO]\"" |
748 |
+ File.pathSeparator + "-KO]\"" |
729 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
749 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
730 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
750 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
731 |
"[5 .class files generated]\n", |
751 |
"", |
732 |
"----------\n" + |
752 |
"----------\n" + |
733 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
753 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
734 |
" (at line 5)\n" + |
754 |
" (at line 5)\n" + |
735 |
" Warn warn;\n" + |
755 |
" Warn warn;\n" + |
736 |
" ^^^^\n" + |
756 |
" ^^^^\n" + |
737 |
"Discouraged access: Warn\n" + |
757 |
"Discouraged access: Warn\n" + |
738 |
"----------\n" + |
758 |
"----------\n" + |
739 |
"----------\n" + |
759 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
740 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
760 |
" (at line 6)\n" + |
741 |
" (at line 6)\n" + |
761 |
" KO ko;\n" + |
742 |
" KO ko;\n" + |
762 |
" ^^\n" + |
743 |
" ^^\n" + |
763 |
"Access restriction: KO\n" + |
744 |
"Access restriction: KO\n" + |
764 |
"----------\n" + |
745 |
"----------\n" + |
765 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
746 |
"----------\n" + |
766 |
" (at line 7)\n" + |
747 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
767 |
" Zork z;\n" + |
748 |
" (at line 7)\n" + |
768 |
" ^^^^\n" + |
749 |
" Zork z;\n" + |
769 |
"Zork cannot be resolved to a type\n" + |
750 |
" ^^^^\n" + |
770 |
"----------\n" + |
751 |
"Zork cannot be resolved to a type\n" + |
771 |
"3 problems (1 error, 2 warnings)", |
752 |
"----------\n" + |
|
|
753 |
"3 problems (1 error, 2 warnings)", |
754 |
true); |
772 |
true); |
755 |
} |
773 |
} |
756 |
// command line - no user classpath nor bootclasspath |
774 |
// command line - no user classpath nor bootclasspath |
757 |
public void _test010(){ |
775 |
public void test010(){ |
758 |
this.runConformTest( |
776 |
this.runConformTest( |
759 |
new String[] { |
777 |
new String[] { |
760 |
"X.java", |
778 |
"X.java", |
Lines 774-784
Link Here
|
774 |
}, |
792 |
}, |
775 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
793 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
776 |
+ " -1.5 -g -preserveAllLocals" |
794 |
+ " -1.5 -g -preserveAllLocals" |
777 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
795 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
778 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
796 |
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", |
779 |
"[1 .class file generated]\n", |
797 |
"", |
780 |
"----------\n" + |
798 |
"----------\n" + |
781 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
799 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
782 |
" (at line 1)\n" + |
800 |
" (at line 1)\n" + |
783 |
" import java.util.List;\n" + |
801 |
" import java.util.List;\n" + |
784 |
" ^^^^^^^^^^^^^^\n" + |
802 |
" ^^^^^^^^^^^^^^\n" + |
Lines 805-932
Link Here
|
805 |
true); |
823 |
true); |
806 |
} |
824 |
} |
807 |
// command line - help |
825 |
// command line - help |
808 |
public void _test012(){ |
826 |
public void test012(){ |
809 |
final String expectedOutput = |
827 |
final String expectedOutput = |
810 |
"{0}\n" + |
828 |
"{0}\n" + |
811 |
" \n" + |
829 |
" \n" + |
812 |
" Usage: <options> <source files | directories>\n" + |
830 |
" Usage: <options> <source files | directories>\n" + |
813 |
" If directories are specified, then their source contents are compiled.\n" + |
831 |
" 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" + |
832 |
" Possible options are listed below. Options enabled by default are prefixed with ''+''\n" + |
815 |
" \n" + |
833 |
" \n" + |
816 |
" Classpath options:\n" + |
834 |
" Classpath options:\n" + |
817 |
" -cp -classpath <directories and zip/jar files separated by {1}>\n" + |
835 |
" -cp -classpath <directories and zip/jar files separated by {1}>\n" + |
818 |
" specify location for application classes and sources. Each\n" + |
836 |
" specify location for application classes and sources. Each\n" + |
819 |
" directory or file can specify access rules for types between\n" + |
837 |
" directory or file can specify access rules for types between\n" + |
820 |
" \'\'[\'\' and \'\']\'\' (e.g. [-X.java] to deny access to type X)\n" + |
838 |
" ''['' and '']'' (e.g. [-X.java] to deny access to type X)\n" + |
821 |
" -bootclasspath <directories and zip/jar files separated by {1}>\n" + |
839 |
" -bootclasspath <directories and zip/jar files separated by {1}>\n" + |
822 |
" specify location for system classes. Each directory or file can\n" + |
840 |
" specify location for system classes. Each directory or file can\n" + |
823 |
" specify access rules for types between \'\'[\'\' and \'\']\'\' (e.g. [-X.java]\n" + |
841 |
" specify access rules for types between ''['' and '']'' (e.g. [-X.java]\n" + |
824 |
" to deny access to type X)\n" + |
842 |
" to deny access to type X)\n" + |
825 |
" -sourcepath <directories and zip/jar files separated by {1}>\n" + |
843 |
" -sourcepath <directories separated by {1}>\n" + |
826 |
" specify location for application sources. Each directory or file can\n" + |
844 |
" specify location for application sources. Each directory can\n" + |
827 |
" specify access rules for types between \'\'[\'\' and \'\']\'\' (e.g. [-X.java]\n" + |
845 |
" specify access rules for types between ''['' and '']'' (e.g. [-X.java]\n" + |
828 |
" to deny access to type X)\n" + |
846 |
" to deny access to type X)\n" + |
829 |
" -extdirs <directories separated by {1}>\n" + |
847 |
" -extdirs <directories separated by {1}>\n" + |
830 |
" specify location for extension zip/jar files\n" + |
848 |
" specify location for extension zip/jar files\n" + |
831 |
" -d <dir> destination directory (if omitted, no directory is created)\n" + |
849 |
" -d <dir> destination directory (if omitted, no directory is created)\n" + |
832 |
" -d none generate no .class files\n" + |
850 |
" -d none generate no .class files\n" + |
833 |
" -encoding <enc> specify custom encoding for all sources. Each file/directory can override it\n" + |
851 |
" -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" + |
852 |
" when suffixed with ''[''<enc>'']'' (e.g. X.java[utf8])\n" + |
835 |
" \n" + |
853 |
" \n" + |
836 |
" Compliance options:\n" + |
854 |
" Compliance options:\n" + |
837 |
" -1.3 use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n" + |
855 |
" -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" + |
856 |
" -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" + |
857 |
" -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" + |
858 |
" -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" + |
859 |
" -source <version> set source level: 1.3 to 1.6 (or 6 or 6.0)\n" + |
842 |
" \n" + |
860 |
" -target <version> set classfile target level: 1.1 to 1.6 (or 6 or 6.0)\n" + |
843 |
" Warning options:\n" + |
861 |
" \n" + |
844 |
" -deprecation + deprecation outside deprecated code\n" + |
862 |
" Warning options:\n" + |
845 |
" -nowarn disable all warnings\n" + |
863 |
" -deprecation + deprecation outside deprecated code\n" + |
846 |
" -warn:none disable all warnings\n" + |
864 |
" -nowarn disable all warnings\n" + |
847 |
" -warn:<warnings separated by ,> enable exactly the listed warnings\n" + |
865 |
" -warn:none disable all warnings\n" + |
848 |
" -warn:+<warnings separated by ,> enable additional warnings\n" + |
866 |
" -warn:<warnings separated by ,> enable exactly the listed warnings\n" + |
849 |
" -warn:-<warnings separated by ,> disable specific warnings\n" + |
867 |
" -warn:+<warnings separated by ,> enable additional warnings\n" + |
850 |
" allDeprecation deprecation including inside deprecated code\n" + |
868 |
" -warn:-<warnings separated by ,> disable specific warnings\n" + |
851 |
" allJavadoc invalid or missing javadoc\n" + |
869 |
" allDeprecation deprecation including inside deprecated code\n" + |
852 |
" assertIdentifier + \'\'assert\'\' used as identifier\n" + |
870 |
" allJavadoc invalid or missing javadoc\n" + |
853 |
" boxing autoboxing conversion\n" + |
871 |
" assertIdentifier + ''assert'' used as identifier\n" + |
854 |
" charConcat + char[] in String concat\n" + |
872 |
" boxing autoboxing conversion\n" + |
855 |
" conditionAssign possible accidental boolean assignment\n" + |
873 |
" charConcat + char[] in String concat\n" + |
856 |
" constructorName + method with constructor name\n" + |
874 |
" conditionAssign possible accidental boolean assignment\n" + |
857 |
" dep-ann missing @Deprecated annotation\n" + |
875 |
" constructorName + method with constructor name\n" + |
858 |
" deprecation + deprecation outside deprecated code\n" + |
876 |
" dep-ann missing @Deprecated annotation\n" + |
859 |
" emptyBlock undocumented empty block\n" + |
877 |
" deprecation + deprecation outside deprecated code\n" + |
860 |
" enumSwitch incomplete enum switch\n" + |
878 |
" emptyBlock undocumented empty block\n" + |
861 |
" fieldHiding field hiding another variable\n" + |
879 |
" enumSwitch incomplete enum switch\n" + |
862 |
" finalBound type parameter with final bound\n" + |
880 |
" fieldHiding field hiding another variable\n" + |
863 |
" finally + finally block not completing normally\n" + |
881 |
" finalBound type parameter with final bound\n" + |
864 |
" indirectStatic indirect reference to static member\n" + |
882 |
" finally + finally block not completing normally\n" + |
865 |
" intfAnnotation + annotation type used as super interface\n" + |
883 |
" hiding macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock\n" + |
866 |
" intfNonInherited + interface non-inherited method compatibility\n" + |
884 |
" incomplete-switch same as enumSwitch\n" + |
867 |
" javadoc invalid javadoc\n" + |
885 |
" indirectStatic indirect reference to static member\n" + |
868 |
" localHiding local variable hiding another variable\n" + |
886 |
" intfAnnotation + annotation type used as super interface\n" + |
869 |
" maskedCatchBlock + hidden catch block\n" + |
887 |
" intfNonInherited + interface non-inherited method compatibility\n" + |
870 |
" nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" + |
888 |
" javadoc invalid javadoc\n" + |
871 |
" noEffectAssign + assignment without effect\n" + |
889 |
" localHiding local variable hiding another variable\n" + |
872 |
" null missing or redundant null check\n" + |
890 |
" maskedCatchBlock + hidden catch block\n" + |
873 |
" over-ann missing @Override annotation\n" + |
891 |
" nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" + |
874 |
" pkgDefaultMethod + attempt to override package-default method\n" + |
892 |
" noEffectAssign + assignment without effect\n" + |
875 |
" semicolon unnecessary semicolon, empty statement\n" + |
893 |
" null missing or redundant null check\n" + |
876 |
" serial + missing serialVersionUID\n" + |
894 |
" over-ann missing @Override annotation\n" + |
877 |
" suppress + enable @SuppressWarnings\n" + |
895 |
" paramAssign assignment to a parameter\n" + |
878 |
" unqualifiedField unqualified reference to field\n" + |
896 |
" pkgDefaultMethod + attempt to override package-default method\n" + |
879 |
" unchecked + unchecked type operation\n" + |
897 |
" raw usage of raw type\n" + |
880 |
" unusedArgument unread method parameter\n" + |
898 |
" semicolon unnecessary semicolon, empty statement\n" + |
881 |
" unusedImport + unused import declaration\n" + |
899 |
" serial + missing serialVersionUID\n" + |
882 |
" unusedLocal unread local variable\n" + |
900 |
" specialParamHiding constructor or setter parameter hiding another field\n" + |
883 |
" unusedPrivate unused private member declaration\n" + |
901 |
" static-access macro for indirectStatic and staticReceiver\n" + |
884 |
" unusedThrown unused declared thrown exception\n" + |
902 |
" staticReceiver + non-static reference to static member\n" + |
885 |
" unnecessaryElse unnecessary else clause\n" + |
903 |
" suppress + enable @SuppressWarnings\n" + |
886 |
" uselessTypeCheck unnecessary cast/instanceof operation\n" + |
904 |
" synthetic-access same as syntheticAccess\n" + |
887 |
" specialParamHiding constructor or setter parameter hiding another field\n" + |
905 |
" syntheticAccess synthetic access for innerclass\n" + |
888 |
" staticReceiver + non-static reference to static member\n" + |
906 |
" tasks(<tags separated by |>) tasks identified by tags inside comments\n" + |
889 |
" syntheticAccess synthetic access for innerclass\n" + |
907 |
" typeHiding + type parameter hiding another type\n" + |
890 |
" tasks(<tags separated by |>) tasks identified by tags inside comments\n" + |
908 |
" unchecked + unchecked type operation\n" + |
891 |
" typeHiding + type parameter hiding another type\n" + |
909 |
" unnecessaryElse unnecessary else clause\n" + |
892 |
" varargsCast + varargs argument need explicit cast\n" + |
910 |
" unqualified-field-access same as unQualifiedField\n" + |
893 |
" warningToken + unhandled warning token in @SuppressWarnings\n" + |
911 |
" unqualifiedField unqualified reference to field\n" + |
894 |
" \n" + |
912 |
" unused macro for unusedArgument, unusedImport, unusedLabel,\n" + |
895 |
" Debug options:\n" + |
913 |
" unusedLocal, unusedPrivate and unusedThrown\n" + |
896 |
" -g[:lines,vars,source] custom debug info\n" + |
914 |
" unusedArgument unread method parameter\n" + |
897 |
" -g:lines,source + both lines table and source debug info\n" + |
915 |
" unusedImport + unused import declaration\n" + |
898 |
" -g all debug info\n" + |
916 |
" unusedLabel + unused label\n" + |
899 |
" -g:none no debug info\n" + |
917 |
" unusedLocal + unread local variable\n" + |
900 |
" -preserveAllLocals preserve unused local vars for debug purpose\n" + |
918 |
" unusedPrivate + unused private member declaration\n" + |
901 |
" \n" + |
919 |
" unusedThrown unused declared thrown exception\n" + |
902 |
" Ignored options:\n" + |
920 |
" uselessTypeCheck unnecessary cast/instanceof operation\n" + |
903 |
" -J<option> pass option to virtual machine (ignored)\n" + |
921 |
" varargsCast + varargs argument need explicit cast\n" + |
904 |
" -X<option> specify non-standard option (ignored)\n" + |
922 |
" warningToken + unhandled warning token in @SuppressWarnings\n" + |
905 |
" -X print non-standard options and exit (ignored)\n" + |
923 |
" \n" + |
906 |
" -O optimize for execution time (ignored)\n" + |
924 |
" Debug options:\n" + |
907 |
" \n" + |
925 |
" -g[:lines,vars,source] custom debug info\n" + |
908 |
" Advanced options:\n" + |
926 |
" -g:lines,source + both lines table and source debug info\n" + |
909 |
" @<file> read command line arguments from file\n" + |
927 |
" -g all debug info\n" + |
910 |
" -maxProblems <n> max number of problems per compilation unit (100 by default)\n" + |
928 |
" -g:none no debug info\n" + |
911 |
" -log <file> log to a file\n" + |
929 |
" -preserveAllLocals preserve unused local vars for debug purpose\n" + |
912 |
" -proceedOnError do not stop at first error, dumping class files with problem methods\n" + |
930 |
" \n" + |
913 |
" -verbose enable verbose output\n" + |
931 |
" Ignored options:\n" + |
914 |
" -referenceInfo compute reference info\n" + |
932 |
" -J<option> pass option to virtual machine (ignored)\n" + |
915 |
" -progress show progress (only in -log mode)\n" + |
933 |
" -X<option> specify non-standard option (ignored)\n" + |
916 |
" -time display speed information \n" + |
934 |
" -X print non-standard options and exit (ignored)\n" + |
917 |
" -noExit do not call System.exit(n) at end of compilation (n==0 if no error)\n" + |
935 |
" -O optimize for execution time (ignored)\n" + |
918 |
" -repeat <n> repeat compilation process <n> times for perf analysis\n" + |
936 |
" \n" + |
919 |
" -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n" + |
937 |
" Advanced options:\n" + |
920 |
" -enableJavadoc consider references in javadoc\n" + |
938 |
" @<file> read command line arguments from file\n" + |
921 |
" \n" + |
939 |
" -maxProblems <n> max number of problems per compilation unit (100 by default)\n" + |
922 |
" -? -help print this help message\n" + |
940 |
" -log <file> log to a file. If the file extension is ''.xml'', then the log\n" + |
923 |
" -v -version print compiler version\n" + |
941 |
" will be a xml file.\n" + |
924 |
" -showversion print compiler version and continue\n" + |
942 |
" -proceedOnError do not stop at first error, dumping class files with problem methods\n" + |
925 |
"\n"; |
943 |
" -verbose enable verbose output\n" + |
|
|
944 |
" -referenceInfo compute reference info\n" + |
945 |
" -progress show progress (only in -log mode)\n" + |
946 |
" -time display speed information \n" + |
947 |
" -noExit do not call System.exit(n) at end of compilation (n==0 if no error)\n" + |
948 |
" -repeat <n> repeat compilation process <n> times for perf analysis\n" + |
949 |
" -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n" + |
950 |
" -enableJavadoc consider references in javadoc\n" + |
951 |
" \n" + |
952 |
" -? -help print this help message\n" + |
953 |
" -v -version print compiler version\n" + |
954 |
" -showversion print compiler version and continue\n" + |
955 |
"\n"; |
926 |
|
956 |
|
927 |
this.runConformTest( |
957 |
this.runConformTest( |
928 |
new String[0], |
958 |
new String[0], |
929 |
" -help -showversion -referenceInfo", |
959 |
" -help -referenceInfo", |
930 |
MessageFormat.format(expectedOutput, new String[] { |
960 |
MessageFormat.format(expectedOutput, new String[] { |
931 |
Main.bind("misc.version", new String[] { |
961 |
Main.bind("misc.version", new String[] { |
932 |
Main.bind("compiler.name"), |
962 |
Main.bind("compiler.name"), |
Lines 939-945
Link Here
|
939 |
} |
969 |
} |
940 |
|
970 |
|
941 |
// command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
971 |
// command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
942 |
public void _test013() { |
972 |
public void test013() { |
943 |
String logFileName = OUTPUT_DIR + File.separator + "log.xml"; |
973 |
String logFileName = OUTPUT_DIR + File.separator + "log.xml"; |
944 |
this.runNegativeTest(new String[] { |
974 |
this.runNegativeTest(new String[] { |
945 |
"X.java", |
975 |
"X.java", |
Lines 952-958
Link Here
|
952 |
+ " -log \"" + logFileName + "\" -d \"" + OUTPUT_DIR + "\"", |
982 |
+ " -log \"" + logFileName + "\" -d \"" + OUTPUT_DIR + "\"", |
953 |
"", |
983 |
"", |
954 |
"----------\n" + |
984 |
"----------\n" + |
955 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
985 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
956 |
" (at line 3)\n" + |
986 |
" (at line 3)\n" + |
957 |
" Zork z;\n" + |
987 |
" Zork z;\n" + |
958 |
" ^^^^\n" + |
988 |
" ^^^^\n" + |
Lines 963-970
Link Here
|
963 |
String logContents = Util.fileContent(logFileName); |
993 |
String logContents = Util.fileContent(logFileName); |
964 |
String expectedLogContents = |
994 |
String expectedLogContents = |
965 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
995 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
966 |
"<!DOCTYPE compiler SYSTEM \"compiler.dtd\">\n" + |
996 |
"<!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" + |
997 |
"<compiler name=\"{1}\" copyright=\"{2}\" version=\"{3}\">\n" + |
968 |
" <command_line>\n" + |
998 |
" <command_line>\n" + |
969 |
" <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + |
999 |
" <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + |
970 |
" <argument value=\"-1.5\"/>\n" + |
1000 |
" <argument value=\"-1.5\"/>\n" + |
Lines 993-998
Link Here
|
993 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + |
1023 |
" <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" + |
1024 |
" <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" + |
1025 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + |
|
|
1026 |
" <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" + |
1027 |
" <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" + |
1028 |
" <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" + |
1029 |
" <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" + |
1033 |
" <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" + |
1034 |
" <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" + |
1035 |
" <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" + |
1036 |
" <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" + |
1037 |
" <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" + |
1038 |
" <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" + |
1039 |
" <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" + |
1040 |
" <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" + |
1041 |
" <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" + |
1042 |
" <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" + |
1045 |
" <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" + |
1046 |
" <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" + |
1047 |
" <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" + |
1048 |
" <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" + |
1049 |
" <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" + |
1050 |
" <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" + |
1051 |
" <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" + |
1053 |
" <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" + |
1054 |
" <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" + |
1055 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + |
|
|
1056 |
" <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" + |
1057 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + |
|
|
1058 |
" <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" + |
1059 |
" <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" + |
1060 |
" <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" + |
1061 |
" <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" + |
1070 |
" <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" + |
1071 |
" <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" + |
1072 |
" <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" + |
1073 |
" <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" + |
|
|
1074 |
" <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" + |
1075 |
" <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" + |
1076 |
" <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" + |
1077 |
" <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" + |
1078 |
" <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" + |
1079 |
" <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" + |
1080 |
" <option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" + |
1047 |
" <option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" + |
1081 |
" <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" + |
1101 |
" <problem_summary problems=\"1\" errors=\"1\" warnings=\"0\" tasks=\"0\"/>\n" + |
1068 |
" </stats>\n" + |
1102 |
" </stats>\n" + |
1069 |
"</compiler>\n"; |
1103 |
"</compiler>\n"; |
1070 |
boolean compareOK = semiNormalizedComparison( |
1104 |
String normalizedExpectedLogContents = |
1071 |
MessageFormat.format( |
1105 |
MessageFormat.format( |
1072 |
expectedLogContents, |
1106 |
expectedLogContents, |
1073 |
new String[] { |
1107 |
new String[] { |
1074 |
File.separator, |
1108 |
File.separator, |
|
|
1109 |
Main.bind("compiler.name"), |
1110 |
Main.bind("compiler.copyright"), |
1075 |
Main.bind("compiler.version") |
1111 |
Main.bind("compiler.version") |
1076 |
}), |
1112 |
}); |
1077 |
logContents, xmlLogsNormalizer); |
1113 |
String normalizedLogContents = |
|
|
1114 |
xmlLogsNormalizer.normalized(logContents); |
1115 |
boolean compareOK = normalizedExpectedLogContents.equals( |
1116 |
normalizedLogContents); |
1078 |
if (!compareOK) { |
1117 |
if (!compareOK) { |
1079 |
System.out.println(getClass().getName() + '#' + getName()); |
1118 |
System.out.println(getClass().getName() + '#' + getName()); |
1080 |
System.out.println( |
1119 |
System.out.println( |
Lines 1086-1093
Link Here
|
1086 |
+ "\n--------- (cut and paste:) ----------\n" |
1125 |
+ "\n--------- (cut and paste:) ----------\n" |
1087 |
+ Util.displayString(xmlLogsNormalizer.normalized(logContents)) |
1126 |
+ Util.displayString(xmlLogsNormalizer.normalized(logContents)) |
1088 |
+ "\n------------- [END LOG] -------------\n"); |
1127 |
+ "\n------------- [END LOG] -------------\n"); |
|
|
1128 |
assertEquals("Unexpected log contents", |
1129 |
normalizedExpectedLogContents, normalizedLogContents); |
1089 |
} |
1130 |
} |
1090 |
assertTrue("unexpected log contents", compareOK); |
|
|
1091 |
} |
1131 |
} |
1092 |
|
1132 |
|
1093 |
// command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
1133 |
// command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 |
Lines 1187-1193
Link Here
|
1187 |
} |
1227 |
} |
1188 |
assertTrue("unexpected log contents", compareOK); |
1228 |
assertTrue("unexpected log contents", compareOK); |
1189 |
} |
1229 |
} |
1190 |
public void _test016(){ |
1230 |
public void test016(){ |
1191 |
this.runConformTest( |
1231 |
this.runConformTest( |
1192 |
new String[] { |
1232 |
new String[] { |
1193 |
"X.java", |
1233 |
"X.java", |
Lines 1206-1216
Link Here
|
1206 |
+ " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1246 |
+ " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1207 |
+ " -verbose -proceedOnError -referenceInfo" |
1247 |
+ " -verbose -proceedOnError -referenceInfo" |
1208 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1248 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1209 |
"[2 .class files generated]\n", |
1249 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
|
|
1250 |
"[reading java/lang/Object.class]\n" + |
1251 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1252 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + |
1253 |
"[writing X.class - #1]\n" + |
1254 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/2]\n" + |
1255 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + |
1256 |
"[writing OK1.class - #2]\n" + |
1257 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + |
1258 |
"[2 units compiled]\n" + |
1259 |
"[2 .class files generated]\n", |
1210 |
"", |
1260 |
"", |
1211 |
true); |
1261 |
true); |
1212 |
} |
1262 |
} |
1213 |
public void _test017(){ |
1263 |
public void test017(){ |
1214 |
this.runConformTest( |
1264 |
this.runConformTest( |
1215 |
new String[] { |
1265 |
new String[] { |
1216 |
"X.java", |
1266 |
"X.java", |
Lines 1227-1242
Link Here
|
1227 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1277 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1228 |
+ " -1.5 -g -preserveAllLocals" |
1278 |
+ " -1.5 -g -preserveAllLocals" |
1229 |
+ " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1279 |
+ " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1230 |
+ " -verbose -proceedOnError -referenceInfo" |
1280 |
+ " -proceedOnError -referenceInfo" |
1231 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1281 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1232 |
"[2 .class files generated]\n", |
1282 |
"", |
1233 |
"incorrect classpath: dummmy_dir\n" + |
1283 |
"incorrect classpath: dummmy_dir\n", |
1234 |
"incorrect classpath: dummy.jar\n" + |
|
|
1235 |
"incorrect classpath: dummy.jar\n", |
1236 |
true); |
1284 |
true); |
1237 |
} |
1285 |
} |
|
|
1286 |
// we tolerate inexisting jars on the classpath |
1287 |
// TODO (maxime) check and document |
1288 |
public void _test017b(){ |
1289 |
this.runConformTest( |
1290 |
new String[] { |
1291 |
"X.java", |
1292 |
"/** */\n" + |
1293 |
"public class X {\n" + |
1294 |
" OK1 ok1;\n" + |
1295 |
"}", |
1296 |
"OK1.java", |
1297 |
"/** */\n" + |
1298 |
"public class OK1 {\n" + |
1299 |
" // empty\n" + |
1300 |
"}" |
1301 |
}, |
1302 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1303 |
+ " -1.5 -g -preserveAllLocals" |
1304 |
+ " -cp dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1305 |
+ " -verbose -proceedOnError -referenceInfo" |
1306 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1307 |
"[2 .class files generated]\n", |
1308 |
"incorrect classpath: dummmy.jar\n", |
1309 |
true); |
1310 |
} |
1311 |
// we tolerate empty classpath entries |
1312 |
// TODO (maxime) check and document |
1313 |
public void _test017c(){ |
1314 |
this.runConformTest( |
1315 |
new String[] { |
1316 |
"X.java", |
1317 |
"/** */\n" + |
1318 |
"public class X {\n" + |
1319 |
" OK1 ok1;\n" + |
1320 |
"}", |
1321 |
"OK1.java", |
1322 |
"/** */\n" + |
1323 |
"public class OK1 {\n" + |
1324 |
" // empty\n" + |
1325 |
"}" |
1326 |
}, |
1327 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1328 |
+ " -1.5 -g -preserveAllLocals" |
1329 |
+ " -cp " + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" |
1330 |
+ " -verbose -proceedOnError -referenceInfo" |
1331 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1332 |
"[2 .class files generated]\n", |
1333 |
"incorrect classpath\n", |
1334 |
true); |
1335 |
} |
1238 |
// command line - unusual classpath (empty, but using current directory, still OK provided |
1336 |
// command line - unusual classpath (empty, but using current directory, still OK provided |
1239 |
// that we execute from the appropriate directory) |
1337 |
// that we execute from the appropriate directory); since there is no notion |
|
|
1338 |
// of current directory for this tests suite, the test is not executed |
1339 |
// TODO (maxime) enforce working directory |
1240 |
public void _test018(){ |
1340 |
public void _test018(){ |
1241 |
this.runConformTest( |
1341 |
this.runConformTest( |
1242 |
new String[] { |
1342 |
new String[] { |
Lines 1259-1265
Link Here
|
1259 |
"", |
1359 |
"", |
1260 |
true); |
1360 |
true); |
1261 |
} |
1361 |
} |
1262 |
public void _test019(){ |
1362 |
public void test019(){ |
1263 |
this.runNegativeTest( |
1363 |
this.runNegativeTest( |
1264 |
new String[] { |
1364 |
new String[] { |
1265 |
"X.java", |
1365 |
"X.java", |
Lines 1295-1330
Link Here
|
1295 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1395 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1296 |
+ " -1.5 -g -preserveAllLocals" |
1396 |
+ " -1.5 -g -preserveAllLocals" |
1297 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\"" |
1397 |
+ " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\"" |
1298 |
+ " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
1398 |
+ " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" |
1299 |
+ " -proceedOnError -referenceInfo" |
1399 |
+ " -proceedOnError -referenceInfo" |
1300 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1400 |
+ " -d \"" + OUTPUT_DIR + "\"", |
1301 |
"[5 .class files generated]\n", |
1401 |
"", |
1302 |
"----------\n" + |
1402 |
"----------\n" + |
1303 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1403 |
"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1304 |
" (at line 5)\n" + |
1404 |
" (at line 5)\n" + |
1305 |
" Warn warn;\n" + |
1405 |
" Warn warn;\n" + |
1306 |
" ^^^^\n" + |
1406 |
" ^^^^\n" + |
1307 |
"Discouraged access: Warn\n" + |
1407 |
"Discouraged access: Warn\n" + |
1308 |
"----------\n" + |
1408 |
"----------\n" + |
1309 |
"----------\n" + |
1409 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1310 |
"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1410 |
" (at line 6)\n" + |
1311 |
" (at line 6)\n" + |
1411 |
" KO ko;\n" + |
1312 |
" KO ko;\n" + |
1412 |
" ^^\n" + |
1313 |
" ^^\n" + |
1413 |
"Access restriction: KO\n" + |
1314 |
"Access restriction: KO\n" + |
1414 |
"----------\n" + |
1315 |
"----------\n" + |
1415 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1316 |
"----------\n" + |
1416 |
" (at line 7)\n" + |
1317 |
"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1417 |
" Zork z;\n" + |
1318 |
" (at line 7)\n" + |
1418 |
" ^^^^\n" + |
1319 |
" Zork z;\n" + |
1419 |
"Zork cannot be resolved to a type\n" + |
1320 |
" ^^^^\n" + |
1420 |
"----------\n" + |
1321 |
"Zork cannot be resolved to a type\n" + |
1421 |
"3 problems (1 error, 2 warnings)", |
1322 |
"----------\n" + |
|
|
1323 |
"3 problems (1 error, 2 warnings)", |
1324 |
true); |
1422 |
true); |
1325 |
} |
1423 |
} |
1326 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed |
1424 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed |
1327 |
public void _test020(){ |
1425 |
public void test020(){ |
1328 |
this.runConformTest( |
1426 |
this.runConformTest( |
1329 |
new String[] { |
1427 |
new String[] { |
1330 |
"X.java", |
1428 |
"X.java", |
Lines 1336-1347
Link Here
|
1336 |
+ " -1.5 -g -preserveAllLocals" |
1434 |
+ " -1.5 -g -preserveAllLocals" |
1337 |
+ " -verbose -proceedOnError -referenceInfo" |
1435 |
+ " -verbose -proceedOnError -referenceInfo" |
1338 |
+ " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu", |
1436 |
+ " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu", |
1339 |
"[1 .class file generated]\n", |
1437 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1340 |
"", |
1438 |
"[reading java/lang/Object.class]\n" + |
|
|
1439 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1440 |
"[writing X.class - #1]\n" + |
1441 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + |
1442 |
"[1 unit compiled]\n" + |
1443 |
"[1 .class file generated]\n", |
1444 |
"", |
1341 |
true); |
1445 |
true); |
1342 |
} |
1446 |
} |
1343 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files |
1447 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files |
1344 |
public void _test021(){ |
1448 |
public void test021(){ |
1345 |
this.runConformTest( |
1449 |
this.runConformTest( |
1346 |
new String[] { |
1450 |
new String[] { |
1347 |
"src1/X.java", |
1451 |
"src1/X.java", |
Lines 1359-1365
Link Here
|
1359 |
+ " -1.5 -g -preserveAllLocals" |
1463 |
+ " -1.5 -g -preserveAllLocals" |
1360 |
+ " -verbose -proceedOnError -referenceInfo" |
1464 |
+ " -verbose -proceedOnError -referenceInfo" |
1361 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1465 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1362 |
"[2 .class files generated]\n", |
1466 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + |
|
|
1467 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1468 |
"[reading java/lang/Object.class]\n" + |
1469 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1470 |
"[writing Y.class - #1]\n" + |
1471 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1472 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1473 |
"[writing X.class - #2]\n" + |
1474 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1475 |
"[2 units compiled]\n" + |
1476 |
"[2 .class files generated]\n", |
1363 |
"", |
1477 |
"", |
1364 |
true); |
1478 |
true); |
1365 |
} |
1479 |
} |
Lines 1411-1417
Link Here
|
1411 |
true); |
1525 |
true); |
1412 |
} |
1526 |
} |
1413 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions |
1527 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions |
1414 |
public void _test024(){ |
1528 |
public void test024(){ |
1415 |
this.runNegativeTest( |
1529 |
this.runNegativeTest( |
1416 |
new String[] { |
1530 |
new String[] { |
1417 |
"X.java", |
1531 |
"X.java", |
Lines 1423-1433
Link Here
|
1423 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1537 |
"\"" + OUTPUT_DIR + File.separator + "X.java\"" |
1424 |
+ " -extdirs \"\"" |
1538 |
+ " -extdirs \"\"" |
1425 |
+ " -1.5 -g -preserveAllLocals" |
1539 |
+ " -1.5 -g -preserveAllLocals" |
1426 |
+ " -verbose -proceedOnError -referenceInfo" |
1540 |
+ " -proceedOnError -referenceInfo" |
1427 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1541 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1428 |
"[1 .class file generated]\n", |
1542 |
"", |
1429 |
"----------\n" + |
1543 |
"----------\n" + |
1430 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + |
1544 |
"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + |
1431 |
" (at line 3)\n" + |
1545 |
" (at line 3)\n" + |
1432 |
" sun.net.spi.nameservice.dns.DNSNameService dummy;\n" + |
1546 |
" sun.net.spi.nameservice.dns.DNSNameService dummy;\n" + |
1433 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
1547 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
Lines 1437-1443
Link Here
|
1437 |
true); |
1551 |
true); |
1438 |
} |
1552 |
} |
1439 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath |
1553 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath |
1440 |
public void _test025(){ |
1554 |
public void test025(){ |
1441 |
this.runConformTest( |
1555 |
this.runConformTest( |
1442 |
new String[] { |
1556 |
new String[] { |
1443 |
"src1/X.java", |
1557 |
"src1/X.java", |
Lines 1456-1467
Link Here
|
1456 |
+ " -1.5 -g -preserveAllLocals" |
1570 |
+ " -1.5 -g -preserveAllLocals" |
1457 |
+ " -verbose -proceedOnError -referenceInfo" |
1571 |
+ " -verbose -proceedOnError -referenceInfo" |
1458 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1572 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1459 |
"[2 .class files generated]\n", |
1573 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + |
|
|
1574 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1575 |
"[reading java/lang/Object.class]\n" + |
1576 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1577 |
"[writing Y.class - #1]\n" + |
1578 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1579 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1580 |
"[reading sun/net/spi/nameservice/dns/DNSNameService.class]\n" + |
1581 |
"[writing X.class - #2]\n" + |
1582 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1583 |
"[2 units compiled]\n" + |
1584 |
"[2 .class files generated]\n", |
1460 |
"", |
1585 |
"", |
1461 |
true); |
1586 |
true); |
1462 |
} |
1587 |
} |
1463 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath |
1588 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath |
1464 |
public void _test026(){ |
1589 |
public void test026(){ |
1465 |
this.runConformTest( |
1590 |
this.runConformTest( |
1466 |
new String[] { |
1591 |
new String[] { |
1467 |
"src1/X.java", |
1592 |
"src1/X.java", |
Lines 1485-1491
Link Here
|
1485 |
+ " -1.5 -g -preserveAllLocals" |
1610 |
+ " -1.5 -g -preserveAllLocals" |
1486 |
+ " -verbose -proceedOnError -referenceInfo" |
1611 |
+ " -verbose -proceedOnError -referenceInfo" |
1487 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1612 |
+ " -d \"" + OUTPUT_DIR + "\" ", |
1488 |
"[2 .class files generated]\n", |
1613 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + |
|
|
1614 |
"[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1615 |
"[reading java/lang/Object.class]\n" + |
1616 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1617 |
"[writing Y.class - #1]\n" + |
1618 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + |
1619 |
"[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1620 |
"[writing X.class - #2]\n" + |
1621 |
"[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + |
1622 |
"[2 units compiled]\n" + |
1623 |
"[2 .class files generated]\n", |
1489 |
"", |
1624 |
"", |
1490 |
true); |
1625 |
true); |
1491 |
} |
1626 |
} |