Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 20930 Details for
Bug 92398
[compiler] Leverage access rule support in batch compiler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Batch compiler test class improvements + access rules tests
patch_org.eclipse.jdt.core.tests.compiler_03_improved_log_comparison.txt (text/plain), 27.34 KB, created by
Maxime Daniel
on 2005-05-11 01:56:43 EDT
(
hide
)
Description:
Batch compiler test class improvements + access rules tests
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2005-05-11 01:56:43 EDT
Size:
27.34 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.8 >diff -u -r1.8 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 23 Feb 2005 02:52:37 -0000 1.8 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 11 May 2005 05:38:06 -0000 >@@ -10,17 +10,267 @@ > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > >+import java.io.File; >+import java.io.FileNotFoundException; >+import java.io.FileOutputStream; >+import java.io.PrintWriter; > import junit.framework.Test; >+import junit.framework.TestSuite; > >+import org.eclipse.jdt.core.tests.util.Util; > import org.eclipse.jdt.internal.compiler.batch.Main; > > public class BatchCompilerTest extends AbstractRegressionTest { >+ public static final String OUTPUT_DIR_PLACEHOLDER = "---OUTPUT_DIR_PLACEHOLDER---"; >+ > public BatchCompilerTest(String name) { > super(name); > } > public static Test suite() { >+ if (false) { >+ TestSuite suite = new TestSuite(); >+ suite.addTest(new BatchCompilerTest("test009")); >+ return suite; >+ } > return setupSuite(testClass()); >+ // TODO find a way to reduce the number of command line tests to one per >+ // test run (aka do not add 1.3, 1.4, 1.5 supplementary level) > } >+ >+ /** >+ * Run a compilation test that is expected to complete successfully and >+ * compare the outputs to expected ones. >+ * >+ * @param testFiles >+ * the source files, given as a suite of file name, file content; >+ * file names are relative to the output directory >+ * @param commandLine >+ * the command line to pass to >+ * {@link Main#compile(String) Main#compile} >+ * @param expectedSuccessOutOutputString >+ * the expected contents of the standard output stream; pass null >+ * to bypass the comparison >+ * @param expectedSuccessErrOutputString >+ * the expected contents of the standard error output stream; >+ * pass null to bypass the comparison >+ * @param shouldFlushOutputDirectory >+ * pass true to get the output directory flushed before the test >+ * runs >+ */ >+ protected void runConformTest(String[] testFiles, String commandLine, >+ String expectedSuccessOutOutputString, >+ String expectedSuccessErrOutputString, >+ boolean shouldFlushOutputDirectory) { >+ File outputDirectory = new File(OUTPUT_DIR); >+ if (shouldFlushOutputDirectory) >+ Util.flushDirectoryContent(outputDirectory); >+ try { >+ if (!outputDirectory.isDirectory()) { >+ outputDirectory.mkdirs(); >+ } >+ PrintWriter sourceFileWriter; >+ for (int i = 0; i < testFiles.length; i += 2) { >+ sourceFileWriter = new PrintWriter(new FileOutputStream( >+ OUTPUT_DIR + File.separator + testFiles[i])); >+ sourceFileWriter.write(testFiles[i + 1]); >+ sourceFileWriter.close(); >+ } >+ } catch (FileNotFoundException e) { >+ e.printStackTrace(); >+ throw new RuntimeException(e); >+ } >+ String printerWritersNameRoot = OUTPUT_DIR + File.separator >+ + testName(); >+ String outFileName = printerWritersNameRoot + "out.txt", errFileName = printerWritersNameRoot + "err.txt"; //$NON-NLS-1$ //$NON-NLS-2$ >+ Main batchCompiler; >+ try { >+ batchCompiler = new Main(new PrintWriter(new FileOutputStream( >+ outFileName)), new PrintWriter(new FileOutputStream( >+ errFileName)), false); >+ } catch (FileNotFoundException e) { >+ System.out.println(getClass().getName() + '#' + getName()); >+ e.printStackTrace(); >+ throw new RuntimeException(e); >+ } >+ boolean compileOK; >+ try { >+ compileOK = batchCompiler.compile(Main.tokenize(commandLine)); >+ } catch (RuntimeException e) { >+ compileOK = false; >+ System.out.println(getClass().getName() + '#' + getName()); >+ e.printStackTrace(); >+ throw e; >+ } >+ String outOutputString = Util.fileContent(outFileName), errOutputString = Util >+ .fileContent(errFileName); >+ boolean compareOK = false; >+ if (compileOK) { >+ compareOK = >+ normalizedComparison(expectedSuccessOutOutputString, >+ expectedSuccessOutOutputString) >+ && normalizedComparison(expectedSuccessErrOutputString, >+ expectedSuccessErrOutputString); >+ } >+ if (!compileOK || !compareOK) { >+ System.out.println(getClass().getName() + '#' + getName()); >+ for (int i = 0; i < testFiles.length; i += 2) { >+ System.out.print(testFiles[i]); >+ System.out.println(" ["); //$NON-NLS-1$ >+ System.out.println(testFiles[i + 1]); >+ System.out.println("]"); //$NON-NLS-1$ >+ } >+ } >+ if (!compileOK) >+ System.out.println(errOutputString); >+ if (compileOK && !compareOK) { >+ System.out.println("--[START OUT]--\n" >+ + "------------- Expected: -------------\n" >+ + expectedSuccessOutOutputString >+ + "------------- but was: -------------\n" >+ + Util.displayString(outOutputString) >+ + "\n---[END OUT]---\n--[START ERR]--\n" >+ + "------------- Expected: -------------\n" >+ + expectedSuccessErrOutputString >+ + "------------- but was: -------------\n" >+ + Util.displayString(errOutputString) >+ + "\n---[END ERR]--\n"); >+ } >+ assertTrue("Unexpected problems: " + errOutputString, compileOK); >+ assertTrue("Unexpected output for invocation with arguments [" >+ + commandLine + "]:\n" + "--[START]--\n" + outOutputString >+ + errOutputString + "---[END]---\n", compareOK); >+ } >+ >+ /** >+ * Run a compilation test that is expected to fail and compare the outputs >+ * to expected ones. >+ * >+ * @param testFiles >+ * the source files, given as a suite of file name, file content; >+ * file names are relative to the output directory >+ * @param commandLine >+ * the command line to pass to >+ * {@link Main#compile(String) Main#compile} >+ * @param expectedSuccessOutOutputString >+ * the expected contents of the standard output stream; pass null >+ * to bypass the comparison >+ * @param expectedSuccessErrOutputString >+ * the expected contents of the standard error output stream; >+ * pass null to bypass the comparison >+ * @param shouldFlushOutputDirectory >+ * pass true to get the output directory flushed before the test >+ * runs >+ */ >+ protected void runNegativeTest(String[] testFiles, String commandLine, >+ String expectedSuccessOutOutputString, >+ String expectedSuccessErrOutputString, >+ boolean shouldFlushOutputDirectory) { >+ File outputDirectory = new File(OUTPUT_DIR); >+ if (shouldFlushOutputDirectory) >+ Util.flushDirectoryContent(outputDirectory); >+ try { >+ if (!outputDirectory.isDirectory()) { >+ outputDirectory.mkdirs(); >+ } >+ PrintWriter sourceFileWriter; >+ for (int i = 0; i < testFiles.length; i += 2) { >+ sourceFileWriter = new PrintWriter(new FileOutputStream( >+ OUTPUT_DIR + File.separator + testFiles[i])); >+ sourceFileWriter.write(testFiles[i + 1]); >+ sourceFileWriter.close(); >+ } >+ } catch (FileNotFoundException e) { >+ e.printStackTrace(); >+ throw new RuntimeException(e); >+ } >+ String printerWritersNameRoot = OUTPUT_DIR + File.separator >+ + testName(); >+ String outFileName = printerWritersNameRoot + "out.txt", errFileName = printerWritersNameRoot + "err.txt"; //$NON-NLS-1$ //$NON-NLS-2$ >+ Main batchCompiler; >+ try { >+ batchCompiler = new Main(new PrintWriter(new FileOutputStream( >+ outFileName)), new PrintWriter(new FileOutputStream( >+ errFileName)), false); >+ } catch (FileNotFoundException e) { >+ System.out.println(getClass().getName() + '#' + getName()); >+ e.printStackTrace(); >+ throw new RuntimeException(e); >+ } >+ boolean compileKO; >+ try { >+ compileKO = !batchCompiler.compile(Main.tokenize(commandLine)); >+ } catch (RuntimeException e) { >+ compileKO = false; >+ System.out.println(getClass().getName() + '#' + getName()); >+ e.printStackTrace(); >+ throw e; >+ } >+ String outOutputString = Util.fileContent(outFileName), errOutputString = Util >+ .fileContent(errFileName); >+ boolean compareOK = false; >+ if (compileKO) { >+ compareOK = >+ normalizedComparison(expectedSuccessOutOutputString, >+ expectedSuccessOutOutputString) >+ && normalizedComparison(expectedSuccessErrOutputString, >+ expectedSuccessErrOutputString); >+ } >+ if (!compileKO || !compareOK) { >+ System.out.println(getClass().getName() + '#' + getName()); >+ for (int i = 0; i < testFiles.length; i += 2) { >+ System.out.print(testFiles[i]); >+ System.out.println(" ["); //$NON-NLS-1$ >+ System.out.println(testFiles[i + 1]); >+ System.out.println("]"); //$NON-NLS-1$ >+ } >+ } >+ if (!compileKO) >+ System.out.println(errOutputString); >+ if (compileKO && !compareOK) { >+ System.out.println("--[START OUT]--\n" >+ + "------------- Expected: -------------\n" >+ + expectedSuccessOutOutputString >+ + "------------- but was: -------------\n" >+ + Util.displayString(outOutputString) >+ + "\n---[END OUT]---\n--[START ERR]--\n" >+ + "------------- Expected: -------------\n" >+ + expectedSuccessErrOutputString >+ + "------------- but was: -------------\n" >+ + Util.displayString(errOutputString) >+ + "\n---[END ERR]--\n"); >+ } >+ assertTrue("Unexpected success: " + errOutputString, compileKO); >+ assertTrue("Unexpected output for invocation with arguments [" >+ + commandLine + "]:\n" + "--[START]--\n" + outOutputString >+ + errOutputString + "---[END]---\n", compareOK); >+ } >+ >+/** >+ * Return true if and only if the two strings passed as parameters compare equal, >+ * modulo the replacement of all OUTPUT_DIR values by a normalized placeholder. >+ * This is meant to erase the variations of OUTPUT_DIR in function of the >+ * test machine, the user account, etc. >+ * @param logA one of the strings to compare >+ * @param logB one of the strings to compare >+ * @return true if logA and logB compare equal once normalized >+ */ >+private boolean normalizedComparison (String logA, String logB) { >+ if (logA == null) >+ return logB == null; >+ if (logB == null) >+ return false; >+ StringBuffer normalizedLogA = new StringBuffer(logA), normalizedLogB = new StringBuffer(logB); >+ int outputDirLength = OUTPUT_DIR.length(), nextOccurrenceIndex; >+ while ((nextOccurrenceIndex = normalizedLogA.indexOf(OUTPUT_DIR)) != -1) >+ normalizedLogA.replace(nextOccurrenceIndex, nextOccurrenceIndex + outputDirLength, >+ OUTPUT_DIR_PLACEHOLDER); >+ // TODO check utils to find a canned suitable substitution >+ while ((nextOccurrenceIndex = normalizedLogB.indexOf(OUTPUT_DIR)) != -1) >+ normalizedLogB.replace(nextOccurrenceIndex, nextOccurrenceIndex + outputDirLength, >+ OUTPUT_DIR_PLACEHOLDER); >+ return normalizedLogA.toString().equals(normalizedLogB.toString()); >+} >+ > public void test01() { > > String commandLine = "-classpath \"D:/a folder\";d:/jdk1.4/jre/lib/rt.jar -1.4 -preserveAllLocals -g -verbose d:/eclipse/workspaces/development2.0/plugins/Bar/src2/ -d d:/test"; >@@ -117,6 +367,331 @@ > expected, > result); > } >+// test the tester - runConformTest >+public void test007(){ >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "import java.util.List;\n" + >+ "\n" + >+ "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + >+ ")\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " if (false) {\n" + >+ " ;\n" + >+ " } else {\n" + >+ " }\n" + >+ " // Zork z;\n" + >+ " }\n" + >+ "}" >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" //$NON-NLS-1$ //$NON-NLS-2$ >+ + " -1.5" //$NON-NLS-1$ >+ + " -g -preserveAllLocals" //$NON-NLS-1$ >+ + " -bootclasspath d:/jdk1.5.0/jre/lib/rt.jar" //$NON-NLS-1$ >+ + " -cp d:/jdk1.5.0/jre/lib/jce.jar" //$NON-NLS-1$ >+ + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" //$NON-NLS-1$ >+ + " -proceedOnError -showversion -referenceInfo" //$NON-NLS-1$ >+ + " -d \"" + OUTPUT_DIR + "\"", //$NON-NLS-1$ //$NON-NLS-2$ >+ "Eclipse Java Compiler 0.556, pre-3.1.0 milestone-7, Copyright IBM Corp 2000, 2005. All rights reserved.\r\n" + >+ "[1 .class file generated]\r\n", >+ "----------\r\n" + >+ "1. WARNING in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 1)\r\n" + >+ " import java.util.List;\r\n" + >+ " ^^^^^^^^^^^^^^\r\n" + >+ "The import java.util.List is never used\r\n" + >+ "----------\r\n" + >+ "1 problem (1 warning)", true); >+} >+// test the tester - runNegativeTest >+public void test008(){ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "import java.util.List;\n" + >+ "\n" + >+ "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + >+ ")\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " if (false) {\n" + >+ " ;\n" + >+ " } else {\n" + >+ " }\n" + >+ " Zork z;\n" + >+ " }\n" + >+ "}" >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" //$NON-NLS-1$ //$NON-NLS-2$ >+ + " -1.5" //$NON-NLS-1$ >+ + " -g -preserveAllLocals" //$NON-NLS-1$ >+ + " -bootclasspath d:/jdk1.5.0/jre/lib/rt.jar" //$NON-NLS-1$ >+ + " -cp d:/jdk1.5.0/jre/lib/jce.jar" //$NON-NLS-1$ >+ + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" //$NON-NLS-1$ >+ + " -proceedOnError -showversion -referenceInfo" //$NON-NLS-1$ >+ + " -d \"" + OUTPUT_DIR + "\"", //$NON-NLS-1$ //$NON-NLS-2$ >+ "Eclipse Java Compiler 0.556, pre-3.1.0 milestone-7, Copyright IBM Corp 2000, 2005. All rights reserved.\r\n" + >+ "[1 .class file generated]\r\n", >+ "----------\r\n" + >+ "1. WARNING in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 1)\r\n" + >+ " import java.util.List;\r\n" + >+ " ^^^^^^^^^^^^^^\r\n" + >+ "The import java.util.List is never used\r\n" + >+ "----------\r\n" + >+ "----------\r\n" + >+ "2. ERROR in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 11)\r\n" + >+ " Zork z;\r\n" + >+ " ^^^^\r\n" + >+ "Zork cannot be resolved to a type\r\n" + >+ "----------\r\n" + >+ "2 problems (1 error, 1 warning)", true); >+} >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not >+public void test009(){ >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "/** */\n" + >+ "public class X {\n" + >+ " OK1 ok1;\n" + >+ " OK2 ok2;\n" + >+ " Warn warn;\n" + >+ " KO ko;\n" + >+ " Zork z;\r\n" + >+ "}", >+ "OK1.java", >+ "/** */\n" + >+ "public class OK1 {\n" + >+ " // empty\n" + >+ "}", >+ "OK2.java", >+ "/** */\n" + >+ "public class OK2 {\n" + >+ " // empty\n" + >+ "}", >+ "Warn.java", >+ "/** */\n" + >+ "public class Warn {\n" + >+ " // empty\n" + >+ "}", >+ "KO.java", >+ "/** */\n" + >+ "public class KO {\n" + >+ " // empty\n" + >+ "}", >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" //$NON-NLS-1$ //$NON-NLS-2$ >+ + " -1.5" //$NON-NLS-1$ >+ + " -g -preserveAllLocals" //$NON-NLS-1$ >+ + " -cp \"" + OUTPUT_DIR //$NON-NLS-1$ >+ + "[+OK2.java;~Warn.java;-KO.java]" //$NON-NLS-1$ >+ + "\"" //$NON-NLS-1$ >+ + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" //$NON-NLS-1$ >+ + " -proceedOnError -showversion -referenceInfo" //$NON-NLS-1$ >+ + " -d \"" + OUTPUT_DIR + "\"", //$NON-NLS-1$ //$NON-NLS-2$ >+ "Eclipse Java Compiler 0.556, pre-3.1.0 milestone-7, Copyright IBM Corp 2000, 2005. All rights reserved.\r\n" + >+ "[5 .class files generated]\r\n", >+ "----------\r\n" + >+ "1. WARNING in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 5)\r\n" + >+ " Warn warn;\r\n" + >+ " ^^^^\r\n" + >+ "Discouraged access: Warn\r\n" + >+ "----------\r\n" + >+ "----------\r\n" + >+ "2. WARNING in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 6)\r\n" + >+ " KO ko;\r\n" + >+ " ^^\r\n" + >+ "Access restriction: KO\r\n" + >+ "----------\r\n" + >+ // access restriction errors are expected to resolve to warnings >+ "----------\r\n" + >+ "3. ERROR in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 7)\r\n" + >+ " Zork z;\r\n" + >+ " ^^^^\r\n" + >+ "Zork cannot be resolved to a type\r\n" + >+ "----------\r\n" + >+ "3 problems (1 error, 2 warnings)", >+ true); >+} >+// command line - no user classpath nor bootclasspath >+public void test010(){ >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "import java.util.List;\n" + >+ "\n" + >+ "@SuppressWarnings(\"all\"//$NON-NLS-1$\n" + >+ ")\n" + >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " if (false) {\n" + >+ " ;\n" + >+ " } else {\n" + >+ " }\n" + >+ " // Zork z;\n" + >+ " }\n" + >+ "}" >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" //$NON-NLS-1$ //$NON-NLS-2$ >+ + " -1.5" //$NON-NLS-1$ >+ + " -g -preserveAllLocals" //$NON-NLS-1$ >+ // + " -bootclasspath d:/jdk1.5.0/jre/lib/rt.jar" //$NON-NLS-1$ >+ // + " -cp d:/jdk1.5.0/jre/lib/jce.jar" //$NON-NLS-1$ >+ + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" //$NON-NLS-1$ >+ + " -proceedOnError -showversion -referenceInfo" //$NON-NLS-1$ >+ + " -d \"" + OUTPUT_DIR + "\"", //$NON-NLS-1$ //$NON-NLS-2$ >+ "Eclipse Java Compiler 0.556, pre-3.1.0 milestone-7, Copyright IBM Corp 2000, 2005. All rights reserved.\r\n" + >+ "[1 .class file generated]\r\n", >+ "----------\r\n" + >+ "1. WARNING in C:\\Documents and Settings\\mdl\\comptest\\regression\\X.java\r\n" + >+ " (at line 1)\r\n" + >+ " import java.util.List;\r\n" + >+ " ^^^^^^^^^^^^^^\r\n" + >+ "The import java.util.List is never used\r\n" + >+ "----------\r\n" + >+ "1 problem (1 warning)", true); >+} >+// command line - improper classpath (ends with ;) >+public void test011(){ >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "/** */\n" + >+ "public class X {\n" + >+ "}", >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" //$NON-NLS-1$ //$NON-NLS-2$ >+ + " -1.5" //$NON-NLS-1$ >+ + " -g -preserveAllLocals" //$NON-NLS-1$ >+ + " -cp \"" + OUTPUT_DIR //$NON-NLS-1$ >+ + "[+**/OK2.java;~**/Warn.java;-KO.java]" //$NON-NLS-1$ >+ + "\";" //$NON-NLS-1$ >+ + " -proceedOnError -showversion -referenceInfo" //$NON-NLS-1$ >+ + " -d \"" + OUTPUT_DIR + "\"", //$NON-NLS-1$ //$NON-NLS-2$ >+ "Eclipse Java Compiler 0.556, pre-3.1.0 milestone-7, Copyright IBM Corp 2000, 2005. All rights reserved.\r\n", >+ "incorrect classpath: C:\\Documents and Settings\\mdl\\comptest\\regression[+**/OK2.java;~**/Warn.java;-KO.java];\r\n", >+ true); >+} >+// command line - help >+public void test012(){ >+ this.runConformTest( >+ new String[0], >+ " -help" //$NON-NLS-1$ >+ + " -showversion -referenceInfo", //$NON-NLS-1$ >+ "Eclipse Java Compiler 0.556, pre-3.1.0 milestone-7, Copyright IBM Corp 2000, 2005. All rights reserved.\n" + >+ " \n" + >+ " Usage: <options> <source files | directories>\n" + >+ " If directories are specified, then their source contents are compiled.\n" + >+ " Possible options are listed below. Options enabled by default are prefixed with \'+\'\n" + >+ " \n" + >+ " Classpath options:\n" + >+ " -cp -classpath <directories and zip/jar files separated by ;>\n" + >+ " specify location for application classes and sources. Each\n" + >+ " directory or file can specify access rules for types between\n" + >+ " \'[\' and \']\' (e.g. [-X.java] to deny access to type X)\n" + >+ " -bootclasspath <directories and zip/jar files separated by ;>\n" + >+ " specify location for system classes. Each directory or file can\n" + >+ " specify access rules for types between \'[\' and \']\' (e.g. [-X.java]\n" + >+ " to deny access to type X)\n" + >+ " -d <dir> destination directory (if omitted, no directory is created)\n" + >+ " -d none generate no .class files\n" + >+ " -encoding <enc> specify custom encoding for all sources. Each file/directory can override it\n" + >+ " when suffixed with \'[\'<enc>\']\' (e.g. X.java[utf8])\n" + >+ " \n" + >+ " Compliance options:\n" + >+ " -1.3 use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n" + >+ " -1.4 + use 1.4 compliance level (implicit -source 1.3 -target 1.2)\n" + >+ " -1.5 use 1.5 compliance level (implicit -source 1.5 -target 1.5)\n" + >+ " -source <version> set source level: 1.3 to 1.5 (or 5 or 5.0)\n" + >+ " -target <version> set classfile target level: 1.1 to 1.5 (or 5 or 5.0)\n" + >+ " \n" + >+ " Warning options:\n" + >+ " -deprecation + deprecation outside deprecated code\n" + >+ " -nowarn disable all warnings\n" + >+ " -warn:none disable all warnings\n" + >+ " -warn:<warnings separated by ,> enable exactly the listed warnings\n" + >+ " -warn:+<warnings separated by ,> enable additional warnings\n" + >+ " -warn:-<warnings separated by ,> disable specific warnings\n" + >+ " allDeprecation deprecation including inside deprecated code\n" + >+ " allJavadoc invalid or missing javadoc\n" + >+ " assertIdentifier + \'assert\' used as identifier\n" + >+ " boxing autoboxing conversion\n" + >+ " charConcat + char[] in String concat\n" + >+ " conditionAssign possible accidental boolean assignment\n" + >+ " constructorName + method with constructor name\n" + >+ " dep-ann missing @Deprecated annotation\n" + >+ " deprecation + deprecation outside deprecated code\n" + >+ " emptyBlock undocumented empty block\n" + >+ " enumSwitch incomplete enum switch\n" + >+ " fieldHiding field hiding another variable\n" + >+ " finalBound type parameter with final bound\n" + >+ " finally + finally block not completing normally\n" + >+ " indirectStatic indirect reference to static member\n" + >+ " intfAnnotation + annotation type used as super interface\n" + >+ " intfNonInherited + interface non-inherited method compatibility\n" + >+ " javadoc invalid javadoc\n" + >+ " localHiding local variable hiding another variable\n" + >+ " maskedCatchBlock + hidden catch block\n" + >+ " nls string literal lacking non-nls tag //$NON-NLS-<n>$\n" + >+ " noEffectAssign + assignment without effect\n" + >+ " null missing or redundant null check\n" + >+ " over-ann missing @Override annotation\n" + >+ " pkgDefaultMethod + attempt to override package-default method\n" + >+ " semicolon unnecessary semicolon, empty statement\n" + >+ " serial + missing serialVersionUID\n" + >+ " suppress + enable @SuppressWarnings\n" + >+ " unqualifiedField unqualified reference to field\n" + >+ " unchecked + unchecked type operation\n" + >+ " unusedArgument unread method parameter\n" + >+ " unusedImport + unused import declaration\n" + >+ " unusedLocal unread local variable\n" + >+ " unusedPrivate unused private member declaration\n" + >+ " unusedThrown unused declared thrown exception\n" + >+ " unnecessaryElse unnecessary else clause\n" + >+ " uselessTypeCheck unnecessary cast/instanceof operation\n" + >+ " specialParamHiding constructor or setter parameter hiding another field\n" + >+ " staticReceiver + non-static reference to static member\n" + >+ " syntheticAccess synthetic access for innerclass\n" + >+ " tasks(<tags separated by |>) tasks identified by tags inside comments\n" + >+ " typeHiding + type parameter hiding another type\n" + >+ " varargsCast + varargs argument need explicit cast\n" + >+ " warningToken + unhandled warning token in @SuppressWarnings\n" + >+ " \n" + >+ " Debug options:\n" + >+ " -g[:lines,vars,source] custom debug info\n" + >+ " -g:lines,source + both lines table and source debug info\n" + >+ " -g all debug info\n" + >+ " -g:none no debug info\n" + >+ " -preserveAllLocals preserve unused local vars for debug purpose\n" + >+ " \n" + >+ " Advanced options:\n" + >+ " @<file> read command line arguments from file\n" + >+ " -maxProblems <n> max number of problems per compilation unit (100 by default)\n" + >+ " -log <file> log to a file\n" + >+ " -proceedOnError do not stop at first error, dumping class files with problem methods\n" + >+ " -verbose enable verbose output\n" + >+ " -referenceInfo compute reference info\n" + >+ " -progress show progress (only in -log mode)\n" + >+ " -time display speed information \n" + >+ " -noExit do not call System.exit(n) at end of compilation (n==0 if no error)\n" + >+ " -repeat <n> repeat compilation process <n> times for perf analysis\n" + >+ " -inlineJSR inline JSR bytecode (implicit if target >= 1.5)\n" + >+ " -enableJavadoc consider references in javadoc\n" + >+ " \n" + >+ " -? -help print this help message\n" + >+ " -v -version print compiler version\n" + >+ " -showversion print compiler version and continue\n" + >+ "\r\n", >+ "", true); >+} >+ > public static Class testClass() { > return BatchCompilerTest.class; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 92398
:
20782
|
20929
|
20930
|
21413
|
21414
|
21716