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 33456 Details for
Bug 99620
[compiler] The batch compiler should not print to the console when taking another output stream in input
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Improved patch plus tests
org.eclipse.jdt.core_08.txt (text/plain), 58.19 KB, created by
Maxime Daniel
on 2006-01-23 07:56:14 EST
(
hide
)
Description:
Improved patch plus tests
Filename:
MIME Type:
Creator:
Maxime Daniel
Created:
2006-01-23 07:56:14 EST
Size:
58.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java,v >retrieving revision 1.115 >diff -u -r1.115 CompilationUnitResolver.java >--- dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 20 Jan 2006 12:10:34 -0000 1.115 >+++ dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java 23 Jan 2006 12:56:38 -0000 >@@ -169,7 +169,7 @@ > new CompilationResult(sourceUnit, index++, maxUnits, this.options.maxProblemsPerUnit); > try { > if (options.verbose) { >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_request, > new String[] { > String.valueOf(index++ + 1), >Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v >retrieving revision 1.226 >diff -u -r1.226 Main.java >--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 23 Jan 2006 10:34:45 -0000 1.226 >+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 23 Jan 2006 12:56:37 -0000 >@@ -966,6 +966,10 @@ > public String destinationPath; > public String[] encodings; > public Logger logger; >+ PrintWriter out; >+ // need to pass the compiler messages output to the delegate compiler >+ // do not user directly (use logger) >+ // TODO (maxime) this is used in one instance - check reason with olivier > public int exportedClassFilesCounter; > public String[] filenames; > public boolean generatePackagesStructure; >@@ -1000,6 +1004,7 @@ > > public Main(PrintWriter outWriter, PrintWriter errWriter, boolean systemExitWhenFinished, Map customDefaultOptions) { > this.logger = new Logger(outWriter, errWriter); >+ this.out = outWriter; > this.systemExitWhenFinished = systemExitWhenFinished; > this.options = new CompilerOptions().getMap(); > if (customDefaultOptions != null) { >@@ -2770,7 +2775,7 @@ > String relativeStringName = new String(relativeName); > try { > if (this.compilerOptions.verbose) >- System.out.println( >+ this.out.println( > Messages.bind( > Messages.compilation_write, > new String[] { >@@ -2810,7 +2815,8 @@ > getHandlingPolicy(), > this.options, > getBatchRequestor(), >- getProblemFactory()); >+ getProblemFactory(), >+ this.out); > this.compilerOptions = batchCompiler.options; > > // set the non-externally configurable options. >Index: compiler/org/eclipse/jdt/internal/compiler/Compiler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/Compiler.java,v >retrieving revision 1.72 >diff -u -r1.72 Compiler.java >--- compiler/org/eclipse/jdt/internal/compiler/Compiler.java 20 Jan 2006 12:10:35 -0000 1.72 >+++ compiler/org/eclipse/jdt/internal/compiler/Compiler.java 23 Jan 2006 12:56:38 -0000 >@@ -27,6 +27,7 @@ > public ICompilerRequestor requestor; > public CompilerOptions options; > public ProblemReporter problemReporter; >+ protected PrintWriter out; // output for messages that are not sent to problemReporter > > // management of unit to be processed > //public CompilationUnitResult currentCompilationUnitResult; >@@ -83,33 +84,62 @@ > * them back as part of the compilation unit result. > */ > public Compiler( >- INameEnvironment environment, >- IErrorHandlingPolicy policy, >- Map settings, >- final ICompilerRequestor requestor, >- IProblemFactory problemFactory) { >- >- // create a problem handler given a handling policy >- this.options = new CompilerOptions(settings); >- >- // wrap requestor in DebugRequestor if one is specified >- if(DebugRequestor == null) { >- this.requestor = requestor; >- } else { >- this.requestor = new ICompilerRequestor(){ >- public void acceptResult(CompilationResult result){ >- if (DebugRequestor.isActive()){ >- DebugRequestor.acceptDebugResult(result); >- } >- requestor.acceptResult(result); >- } >- }; >- } >- this.problemReporter = >- new ProblemReporter(policy, this.options, problemFactory); >- this.lookupEnvironment = >- new LookupEnvironment(this, this.options, this.problemReporter, environment); >- initializeParser(); >+ INameEnvironment environment, >+ IErrorHandlingPolicy policy, >+ Map settings, >+ final ICompilerRequestor requestor, >+ IProblemFactory problemFactory) { >+ this(environment, policy, settings, requestor, problemFactory, >+ null, false, false, false, false); // all defaults >+ } >+ >+ /** >+ * Answer a new compiler using the given name environment and compiler options. >+ * The environment and options will be in effect for the lifetime of the compiler. >+ * When the compiler is run, compilation results are sent to the given requestor. >+ * >+ * @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment >+ * Environment used by the compiler in order to resolve type and package >+ * names. The name environment implements the actual connection of the compiler >+ * to the outside world (e.g. in batch mode the name environment is performing >+ * pure file accesses, reuse previous build state or connection to repositories). >+ * Note: the name environment is responsible for implementing the actual classpath >+ * rules. >+ * >+ * @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy >+ * Configurable part for problem handling, allowing the compiler client to >+ * specify the rules for handling problems (stop on first error or accumulate >+ * them all) and at the same time perform some actions such as opening a dialog >+ * in UI when compiling interactively. >+ * @see org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies >+ * >+ * @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor >+ * Component which will receive and persist all compilation results and is intended >+ * to consume them as they are produced. Typically, in a batch compiler, it is >+ * responsible for writing out the actual .class files to the file system. >+ * @see org.eclipse.jdt.internal.compiler.CompilationResult >+ * >+ * @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory >+ * Factory used inside the compiler to create problem descriptors. It allows the >+ * compiler client to supply its own representation of compilation problems in >+ * order to avoid object conversions. Note that the factory is not supposed >+ * to accumulate the created problems, the compiler will gather them all and hand >+ * them back as part of the compilation unit result. >+ * >+ * @param out java.io.PrintWriter >+ * Used by the compiler to output messages which are not related to problems, >+ * e.g. the information issued in verbose mode. If null, defaults to System.out >+ * with automatic flushing. >+ */ >+ public Compiler( >+ INameEnvironment environment, >+ IErrorHandlingPolicy policy, >+ Map settings, >+ final ICompilerRequestor requestor, >+ IProblemFactory problemFactory, >+ PrintWriter out) { >+ this(environment, policy, settings, requestor, problemFactory, out, >+ false, false, false, false); // all defaults > } > > /** >@@ -144,27 +174,107 @@ > * order to avoid object conversions. Note that the factory is not supposed > * to accumulate the created problems, the compiler will gather them all and hand > * them back as part of the compilation unit result. >+ * > * @param parseLiteralExpressionsAsConstants <code>boolean</code> > * This parameter is used to optimize the literals or leave them as they are in the source. > * If you put true, "Hello" + " world" will be converted to "Hello world". >+ * >+ * @param storeAnnotations <code>boolean</code> >+ * This parameter is used to tell the compiler to store annotations on >+ * type bindings, or not. >+ * >+ * @param statementsRecovery <code>boolean</code> >+ * This parameter is used to tell the compiler to perform syntax error >+ * recovery on statements, or not. > */ > public Compiler( >- INameEnvironment environment, >- IErrorHandlingPolicy policy, >- Map settings, >- final ICompilerRequestor requestor, >- IProblemFactory problemFactory, >- boolean parseLiteralExpressionsAsConstants, >- boolean storeAnnotations, >- boolean statementsRecovery) { >+ INameEnvironment environment, >+ IErrorHandlingPolicy policy, >+ Map settings, >+ final ICompilerRequestor requestor, >+ IProblemFactory problemFactory, >+ boolean parseLiteralExpressionsAsConstants, >+ boolean storeAnnotations, >+ boolean statementsRecovery) { >+ this(environment, policy, settings, requestor, problemFactory, >+ null, // default >+ parseLiteralExpressionsAsConstants, storeAnnotations, statementsRecovery, true); >+ } >+ >+ /** >+ * Answer a new compiler using the given name environment and compiler options. >+ * The environment and options will be in effect for the lifetime of the compiler. >+ * When the compiler is run, compilation results are sent to the given requestor. >+ * >+ * @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment >+ * Environment used by the compiler in order to resolve type and package >+ * names. The name environment implements the actual connection of the compiler >+ * to the outside world (e.g. in batch mode the name environment is performing >+ * pure file accesses, reuse previous build state or connection to repositories). >+ * Note: the name environment is responsible for implementing the actual classpath >+ * rules. >+ * >+ * @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy >+ * Configurable part for problem handling, allowing the compiler client to >+ * specify the rules for handling problems (stop on first error or accumulate >+ * them all) and at the same time perform some actions such as opening a dialog >+ * in UI when compiling interactively. >+ * @see org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies >+ * >+ * @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor >+ * Component which will receive and persist all compilation results and is intended >+ * to consume them as they are produced. Typically, in a batch compiler, it is >+ * responsible for writing out the actual .class files to the file system. >+ * @see org.eclipse.jdt.internal.compiler.CompilationResult >+ * >+ * @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory >+ * Factory used inside the compiler to create problem descriptors. It allows the >+ * compiler client to supply its own representation of compilation problems in >+ * order to avoid object conversions. Note that the factory is not supposed >+ * to accumulate the created problems, the compiler will gather them all and hand >+ * them back as part of the compilation unit result. >+ * >+ * @param out java.io.PrintWriter >+ * Used by the compiler to output messages which are not related to problems, >+ * e.g. the information issued in verbose mode. If null, defaults to System.out >+ * with automatic flushing. >+ * >+ * @param parseLiteralExpressionsAsConstants <code>boolean</code> >+ * This parameter is used to optimize the literals or leave them as they are in the source. >+ * If you put true, "Hello" + " world" will be converted to "Hello world". >+ * >+ * @param storeAnnotations <code>boolean</code> >+ * This parameter is used to tell the compiler to store annotations on >+ * type bindings, or not. >+ * >+ * @param statementsRecovery <code>boolean</code> >+ * This parameter is used to tell the compiler to perform syntax error >+ * recovery on statements, or not. >+ * >+ * @param flag <code>boolean</code> >+ * Set to true if and only if the other boolean parameters are significant. >+ */ >+ private Compiler( >+ INameEnvironment environment, >+ IErrorHandlingPolicy policy, >+ Map settings, >+ final ICompilerRequestor requestor, >+ IProblemFactory problemFactory, >+ PrintWriter out, >+ boolean parseLiteralExpressionsAsConstants, >+ boolean storeAnnotations, >+ boolean statementsRecovery, >+ boolean flag) { > > // create a problem handler given a handling policy > this.options = new CompilerOptions(settings); >- this.options.parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants; >- this.options.storeAnnotations = storeAnnotations; >- this.options.performStatementsRecovery = >- statementsRecovery && >- this.options.performStatementsRecovery;// TODO temporary code to take into account the temporary JavaCore options >+ if (flag) { // boolean parameters are significant, pass them down >+ this.options.parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants; >+ this.options.storeAnnotations = storeAnnotations; >+ this.options.performStatementsRecovery = >+ statementsRecovery && >+ this.options.performStatementsRecovery;// TODO temporary code to take into account the temporary JavaCore options >+ } > > // wrap requestor in DebugRequestor if one is specified > if(DebugRequestor == null) { >@@ -181,6 +291,7 @@ > } > this.problemReporter = new ProblemReporter(policy, this.options, problemFactory); > this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, environment); >+ this.out = out == null ? new PrintWriter(System.out, true) : out; > initializeParser(); > } > >@@ -189,7 +300,7 @@ > */ > public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { > if (this.options.verbose) { >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName()))); > // new Exception("TRACE BINARY").printStackTrace(System.out); > // System.out.println(); >@@ -208,7 +319,7 @@ > try { > if (options.verbose) { > String count = String.valueOf(totalUnits + 1); >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_request, > new String[] { > count, >@@ -281,7 +392,7 @@ > new CompilationResult(sourceUnits[i], i, maxUnits, this.options.maxProblemsPerUnit); > try { > if (options.verbose) { >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_request, > new String[] { > String.valueOf(i + 1), >@@ -326,7 +437,7 @@ > unit = unitsToProcess[i]; > try { > if (options.verbose) >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_process, > new String[] { > String.valueOf(i + 1), >@@ -341,7 +452,7 @@ > unitsToProcess[i] = null; // release reference to processed unit declaration > requestor.acceptResult(unit.compilationResult.tagAsAccepted()); > if (options.verbose) >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_done, > new String[] { > String.valueOf(i + 1), >@@ -362,10 +473,10 @@ > } > if (options.verbose) { > if (this.totalUnits > 1) { >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits))); > } else { >- System.out.println( >+ this.out.println( > Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits))); > } > } >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.34 >diff -u -r1.34 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 23 Jan 2006 10:34:27 -0000 1.34 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 23 Jan 2006 12:56:42 -0000 >@@ -618,7 +618,7 @@ > result); > } > // test the tester - runConformTest >-public void _test007(){ >+public void test007(){ > this.runConformTest( > new String[] { > "X.java", >@@ -640,20 +640,24 @@ > + " -1.5 -g -preserveAllLocals" > + " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar" > + " -cp " + JRE_HOME_DIR + "/lib/jce.jar" >- + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" >- + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", >- "[1 .class file generated]\n", >- "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 1)\n" + >- " import java.util.List;\n" + >- " ^^^^^^^^^^^^^^\n" + >- "The import java.util.List is never used\n" + >- "----------\n" + >- "1 problem (1 warning)", true); >+ + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" >+ + " -verbose -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[reading java/util/List.class]\n" + >+ "[reading java/lang/SuppressWarnings.class]\n" + >+ "[reading java/lang/String.class]\n" + >+ "[writing X.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[1 unit compiled]\n" + >+ "[1 .class file generated]\n", >+ "", // changed with bug 123522: now the SuppressWarning upon the first type >+ // influences warnings on unused imports >+ true); > } > // test the tester - runNegativeTest >-public void _test008(){ >+public void test008(){ > this.runNegativeTest( > new String[] { > "X.java", >@@ -675,9 +679,9 @@ > + " -1.5 -g -preserveAllLocals" > + " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar" > + " -cp " + JRE_HOME_DIR + "/lib/jce.jar" >- + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" >+ + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" > + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", >- "[1 .class file generated]\n", >+ "", > "----------\n" + > "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + > " (at line 11)\n" + >@@ -689,7 +693,7 @@ > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not > // revisit this test case depending on https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349 >-public void _test009(){ >+public void test009(){ > this.runNegativeTest( > new String[] { > "X.java", >@@ -726,35 +730,33 @@ > + " -1.5 -g -preserveAllLocals" > + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" > + File.pathSeparator + "-KO]\"" >- + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" >+ + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" > + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", >- "[5 .class files generated]\n", >- "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 5)\n" + >- " Warn warn;\n" + >- " ^^^^\n" + >- "Discouraged access: Warn\n" + >- "----------\n" + >- "----------\n" + >- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 6)\n" + >- " KO ko;\n" + >- " ^^\n" + >- "Access restriction: KO\n" + >- "----------\n" + >- "----------\n" + >- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 7)\n" + >- " Zork z;\n" + >- " ^^^^\n" + >- "Zork cannot be resolved to a type\n" + >- "----------\n" + >- "3 problems (1 error, 2 warnings)", >+ "", >+ "----------\n" + >+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + >+ " (at line 5)\n" + >+ " Warn warn;\n" + >+ " ^^^^\n" + >+ "Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + >+ "----------\n" + >+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + >+ " (at line 6)\n" + >+ " KO ko;\n" + >+ " ^^\n" + >+ "Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + >+ "----------\n" + >+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + >+ " (at line 7)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3 problems (1 error, 2 warnings)", > true); > } > // command line - no user classpath nor bootclasspath >-public void _test010(){ >+public void test010(){ > this.runConformTest( > new String[] { > "X.java", >@@ -776,15 +778,18 @@ > + " -1.5 -g -preserveAllLocals" > + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" > + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"", >- "[1 .class file generated]\n", >- "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 1)\n" + >- " import java.util.List;\n" + >- " ^^^^^^^^^^^^^^\n" + >- "The import java.util.List is never used\n" + >- "----------\n" + >- "1 problem (1 warning)", true); >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[reading java/util/List.class]\n" + >+ "[reading java/lang/SuppressWarnings.class]\n" + >+ "[reading java/lang/String.class]\n" + >+ "[writing X.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[1 unit compiled]\n" + >+ "[1 .class file generated]\n", >+ "", >+ true); > } > // command line - unusual classpath (ends with ';', still OK) > public void test011(){ >@@ -805,141 +810,155 @@ > true); > } > // command line - help >-public void _test012(){ >+public void test012(){ > final String expectedOutput = > "{0}\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 {1}>\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 {1}>\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" + >- " -sourcepath <directories and zip/jar files separated by {1}>\n" + >- " specify location for application sources. 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" + >- " -extdirs <directories separated by {1}>\n" + >- " specify location for extension zip/jar files\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" + >- " Ignored options:\n" + >- " -J<option> pass option to virtual machine (ignored)\n" + >- " -X<option> specify non-standard option (ignored)\n" + >- " -X print non-standard options and exit (ignored)\n" + >- " -O optimize for execution time (ignored)\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" + >- "\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] to forbid access to type X, [~X] to\n" + >+ " discourage access to type X, [+p/X:-p/*] to forbid access to all\n" + >+ " types in package p but allow access to p/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 '']''\n" + >+ " -sourcepath <directories separated by :>\n" + >+ " specify location for application sources. Each directory can\n" + >+ " specify access rules for types between ''['' and '']''\n" + >+ " -extdirs <directories separated by :>\n" + >+ " specify location for extension zip/jar files\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" + >+ " -1.6 use 1.6 compliance level (implicit -source 1.6 -target 1.6)\n" + >+ " -source <version> set source level: 1.3 to 1.6 (or 6 or 6.0)\n" + >+ " -target <version> set classfile target level: 1.1 to 1.6 (or 6 or 6.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" + >+ " discouraged + use of types matching a discouraged access rule\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" + >+ " forbidden + use of types matching a forbidden access rule\n" + >+ " hiding macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock\n" + >+ " incomplete-switch same as enumSwitch\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" + >+ " paramAssign assignment to a parameter\n" + >+ " pkgDefaultMethod + attempt to override package-default method\n" + >+ " raw usage of raw type\n" + >+ " semicolon unnecessary semicolon, empty statement\n" + >+ " serial + missing serialVersionUID\n" + >+ " specialParamHiding constructor or setter parameter hiding another field\n" + >+ " static-access macro for indirectStatic and staticReceiver\n" + >+ " staticReceiver + non-static reference to static member\n" + >+ " suppress + enable @SuppressWarnings\n" + >+ " synthetic-access same as syntheticAccess\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" + >+ " unchecked + unchecked type operation\n" + >+ " unnecessaryElse unnecessary else clause\n" + >+ " unqualified-field-access same as unQualifiedField\n" + >+ " unqualifiedField unqualified reference to field\n" + >+ " unused macro for unusedArgument, unusedImport, unusedLabel,\n" + >+ " unusedLocal, unusedPrivate and unusedThrown\n" + >+ " unusedArgument unread method parameter\n" + >+ " unusedImport + unused import declaration\n" + >+ " unusedLabel + unused label\n" + >+ " unusedLocal + unread local variable\n" + >+ " unusedPrivate + unused private member declaration\n" + >+ " unusedThrown unused declared thrown exception\n" + >+ " uselessTypeCheck unnecessary cast/instanceof operation\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" + >+ " Ignored options:\n" + >+ " -J<option> pass option to virtual machine (ignored)\n" + >+ " -X<option> specify non-standard option (ignored)\n" + >+ " -X print non-standard options and exit (ignored)\n" + >+ " -O optimize for execution time (ignored)\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. If the file extension is ''.xml'', then the log\n" + >+ " will be a xml 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" + >+ "\n"; > > this.runConformTest( > new String[0], >- " -help -showversion -referenceInfo", >+ " -help -referenceInfo", > MessageFormat.format(expectedOutput, new String[] { > Main.bind("misc.version", new String[] { > Main.bind("compiler.name"), > Main.bind("compiler.version"), > Main.bind("compiler.copyright") > }), >- File.pathSeparator >+ // File.pathSeparator > }), > "", true); > } > > // command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 >- public void _test013() { >+ public void test013() { > String logFileName = OUTPUT_DIR + File.separator + "log.xml"; > this.runNegativeTest(new String[] { > "X.java", >@@ -963,8 +982,8 @@ > String logContents = Util.fileContent(logFileName); > String expectedLogContents = > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >- "<!DOCTYPE compiler SYSTEM \"compiler.dtd\">\n" + >- "<compiler name=\"Eclipse Java Compiler\" copyright=\"Copyright IBM Corp 2000, 2005. All rights reserved.\" version=\"{1}\">\n" + >+ "<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.001 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_001.dtd\">\n" + >+ "<compiler name=\"{1}\" copyright=\"{2}\" version=\"{3}\">\n" + > " <command_line>\n" + > " <argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + > " <argument value=\"-1.5\"/>\n" + >@@ -993,6 +1012,7 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.fatalOptionalError\" value=\"enabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + >@@ -1002,10 +1022,10 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"enabled\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"enabled\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"enabled\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"private\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"disabled\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"disabled\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"disabled\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"public\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation\" value=\"ignore\"/>\n" + >@@ -1014,7 +1034,7 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"private\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" + >@@ -1022,7 +1042,9 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + >@@ -1037,11 +1059,12 @@ > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"ignore\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" + >- " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"ignore\"/>\n" + >+ " <option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" + > " <option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" + >@@ -1067,14 +1090,19 @@ > " <problem_summary problems=\"1\" errors=\"1\" warnings=\"0\" tasks=\"0\"/>\n" + > " </stats>\n" + > "</compiler>\n"; >- boolean compareOK = semiNormalizedComparison( >+ String normalizedExpectedLogContents = > MessageFormat.format( > expectedLogContents, > new String[] { > File.separator, >+ Main.bind("compiler.name"), >+ Main.bind("compiler.copyright"), > Main.bind("compiler.version") >- }), >- logContents, xmlLogsNormalizer); >+ }); >+ String normalizedLogContents = >+ xmlLogsNormalizer.normalized(logContents); >+ boolean compareOK = normalizedExpectedLogContents.equals( >+ normalizedLogContents); > if (!compareOK) { > System.out.println(getClass().getName() + '#' + getName()); > System.out.println( >@@ -1086,8 +1114,9 @@ > + "\n--------- (cut and paste:) ----------\n" > + Util.displayString(xmlLogsNormalizer.normalized(logContents)) > + "\n------------- [END LOG] -------------\n"); >+ assertEquals("Unexpected log contents", >+ normalizedExpectedLogContents, normalizedLogContents); > } >- assertTrue("unexpected log contents", compareOK); > } > > // command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904 >@@ -1187,7 +1216,7 @@ > } > assertTrue("unexpected log contents", compareOK); > } >-public void _test016(){ >+public void test016(){ > this.runConformTest( > new String[] { > "X.java", >@@ -1206,11 +1235,21 @@ > + " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" > + " -verbose -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\"", >- "[2 .class files generated]\n", >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + >+ "[writing X.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/2]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + >+ "[writing OK1.class - #2]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + >+ "[2 units compiled]\n" + >+ "[2 .class files generated]\n", > "", > true); > } >-public void _test017(){ >+public void test017(){ > this.runConformTest( > new String[] { > "X.java", >@@ -1227,16 +1266,66 @@ > "\"" + OUTPUT_DIR + File.separator + "X.java\"" > + " -1.5 -g -preserveAllLocals" > + " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" >- + " -verbose -proceedOnError -referenceInfo" >+ + " -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\"", >- "[2 .class files generated]\n", >- "incorrect classpath: dummmy_dir\n" + >- "incorrect classpath: dummy.jar\n" + >- "incorrect classpath: dummy.jar\n", >+ "", >+ "incorrect classpath: dummmy_dir\n", > true); > } >+// we tolerate inexisting jars on the classpath >+// TODO (maxime) check and document >+public void _test017b(){ >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "/** */\n" + >+ "public class X {\n" + >+ " OK1 ok1;\n" + >+ "}", >+ "OK1.java", >+ "/** */\n" + >+ "public class OK1 {\n" + >+ " // empty\n" + >+ "}" >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" >+ + " -1.5 -g -preserveAllLocals" >+ + " -cp dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" >+ + " -verbose -proceedOnError -referenceInfo" >+ + " -d \"" + OUTPUT_DIR + "\"", >+ "[2 .class files generated]\n", >+ "incorrect classpath: dummmy.jar\n", >+ true); >+} >+// we tolerate empty classpath entries >+// TODO (maxime) check and document >+public void _test017c(){ >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "/** */\n" + >+ "public class X {\n" + >+ " OK1 ok1;\n" + >+ "}", >+ "OK1.java", >+ "/** */\n" + >+ "public class OK1 {\n" + >+ " // empty\n" + >+ "}" >+ }, >+ "\"" + OUTPUT_DIR + File.separator + "X.java\"" >+ + " -1.5 -g -preserveAllLocals" >+ + " -cp " + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" >+ + " -verbose -proceedOnError -referenceInfo" >+ + " -d \"" + OUTPUT_DIR + "\"", >+ "[2 .class files generated]\n", >+ "incorrect classpath\n", >+ true); >+} > // command line - unusual classpath (empty, but using current directory, still OK provided >-// that we execute from the appropriate directory) >+// that we execute from the appropriate directory); since there is no notion >+// of current directory for this tests suite, the test is not executed >+// TODO (maxime) enforce working directory > public void _test018(){ > this.runConformTest( > new String[] { >@@ -1259,7 +1348,7 @@ > "", > true); > } >-public void _test019(){ >+public void test019(){ > this.runNegativeTest( > new String[] { > "X.java", >@@ -1295,36 +1384,34 @@ > "\"" + OUTPUT_DIR + File.separator + "X.java\"" > + " -1.5 -g -preserveAllLocals" > + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\"" >- + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" >+ + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" > + " -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\"", >- "[5 .class files generated]\n", >- "----------\n" + >- "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 5)\n" + >- " Warn warn;\n" + >- " ^^^^\n" + >- "Discouraged access: Warn\n" + >- "----------\n" + >- "----------\n" + >- "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 6)\n" + >- " KO ko;\n" + >- " ^^\n" + >- "Access restriction: KO\n" + >- "----------\n" + >- "----------\n" + >- "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + >- " (at line 7)\n" + >- " Zork z;\n" + >- " ^^^^\n" + >- "Zork cannot be resolved to a type\n" + >- "----------\n" + >- "3 problems (1 error, 2 warnings)", >+ "", >+ "----------\n" + >+ "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + >+ " (at line 5)\n" + >+ " Warn warn;\n" + >+ " ^^^^\n" + >+ "Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + >+ "----------\n" + >+ "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + >+ " (at line 6)\n" + >+ " KO ko;\n" + >+ " ^^\n" + >+ "Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + >+ "----------\n" + >+ "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + >+ " (at line 7)\n" + >+ " Zork z;\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n" + >+ "3 problems (1 error, 2 warnings)", > true); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed >- public void _test020(){ >+ public void test020(){ > this.runConformTest( > new String[] { > "X.java", >@@ -1336,12 +1423,18 @@ > + " -1.5 -g -preserveAllLocals" > + " -verbose -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu", >- "[1 .class file generated]\n", >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[writing X.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + >+ "[1 unit compiled]\n" + >+ "[1 .class file generated]\n", > "", > true); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files >- public void _test021(){ >+ public void test021(){ > this.runConformTest( > new String[] { > "src1/X.java", >@@ -1359,7 +1452,17 @@ > + " -1.5 -g -preserveAllLocals" > + " -verbose -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\" ", >- "[2 .class files generated]\n", >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + >+ "[writing Y.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[writing X.class - #2]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[2 units compiled]\n" + >+ "[2 .class files generated]\n", > "", > true); > } >@@ -1411,7 +1514,7 @@ > true); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions >- public void _test024(){ >+ public void test024(){ > this.runNegativeTest( > new String[] { > "X.java", >@@ -1423,9 +1526,9 @@ > "\"" + OUTPUT_DIR + File.separator + "X.java\"" > + " -extdirs \"\"" > + " -1.5 -g -preserveAllLocals" >- + " -verbose -proceedOnError -referenceInfo" >+ + " -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\" ", >- "[1 .class file generated]\n", >+ "", > "----------\n" + > "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + > " (at line 3)\n" + >@@ -1437,7 +1540,7 @@ > true); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath >- public void _test025(){ >+ public void test025(){ > this.runConformTest( > new String[] { > "src1/X.java", >@@ -1456,12 +1559,23 @@ > + " -1.5 -g -preserveAllLocals" > + " -verbose -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\" ", >- "[2 .class files generated]\n", >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + >+ "[writing Y.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[reading sun/net/spi/nameservice/dns/DNSNameService.class]\n" + >+ "[writing X.class - #2]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[2 units compiled]\n" + >+ "[2 .class files generated]\n", > "", > true); > } > // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath >- public void _test026(){ >+ public void test026(){ > this.runConformTest( > new String[] { > "src1/X.java", >@@ -1485,7 +1599,17 @@ > + " -1.5 -g -preserveAllLocals" > + " -verbose -proceedOnError -referenceInfo" > + " -d \"" + OUTPUT_DIR + "\" ", >- "[2 .class files generated]\n", >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + >+ "[parsing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[reading java/lang/Object.class]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + >+ "[writing Y.class - #1]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + >+ "[analyzing ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[writing X.class - #2]\n" + >+ "[completed ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + >+ "[2 units compiled]\n" + >+ "[2 .class files generated]\n", > "", > true); > }
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 99620
:
33254
| 33456