View | Details | Raw Unified | Return to bug 99620 | Differences between
and this patch

Collapse All | Expand All

(-)dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java (-1 / +1 lines)
Lines 169-175 Link Here
169
				new CompilationResult(sourceUnit, index++, maxUnits, this.options.maxProblemsPerUnit);
169
				new CompilationResult(sourceUnit, index++, maxUnits, this.options.maxProblemsPerUnit);
170
			try {
170
			try {
171
				if (options.verbose) {
171
				if (options.verbose) {
172
					System.out.println(
172
					this.out.println(
173
						Messages.bind(Messages.compilation_request,
173
						Messages.bind(Messages.compilation_request,
174
						new String[] {
174
						new String[] {
175
							String.valueOf(index++ + 1),
175
							String.valueOf(index++ + 1),
(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-2 / +8 lines)
Lines 966-971 Link Here
966
	public String destinationPath;
966
	public String destinationPath;
967
	public String[] encodings;
967
	public String[] encodings;
968
	public Logger logger;
968
	public Logger logger;
969
	PrintWriter out; 
970
		// need to pass the compiler messages output to the delegate compiler
971
		// do not user directly (use logger)
972
		// TODO (maxime) this is used in one instance - check reason with olivier
969
	public int exportedClassFilesCounter;
973
	public int exportedClassFilesCounter;
970
	public String[] filenames;
974
	public String[] filenames;
971
	public boolean generatePackagesStructure;
975
	public boolean generatePackagesStructure;
Lines 1000-1005 Link Here
1000
	
1004
	
1001
	public Main(PrintWriter outWriter, PrintWriter errWriter, boolean systemExitWhenFinished, Map customDefaultOptions) {
1005
	public Main(PrintWriter outWriter, PrintWriter errWriter, boolean systemExitWhenFinished, Map customDefaultOptions) {
1002
		this.logger = new Logger(outWriter, errWriter);
1006
		this.logger = new Logger(outWriter, errWriter);
1007
		this.out = outWriter;
1003
		this.systemExitWhenFinished = systemExitWhenFinished;
1008
		this.systemExitWhenFinished = systemExitWhenFinished;
1004
		this.options = new CompilerOptions().getMap();
1009
		this.options = new CompilerOptions().getMap();
1005
		if (customDefaultOptions != null) {
1010
		if (customDefaultOptions != null) {
Lines 2770-2776 Link Here
2770
					String relativeStringName = new String(relativeName);
2775
					String relativeStringName = new String(relativeName);
2771
					try {
2776
					try {
2772
						if (this.compilerOptions.verbose)
2777
						if (this.compilerOptions.verbose)
2773
							System.out.println(
2778
							this.out.println(
2774
								Messages.bind(
2779
								Messages.bind(
2775
									Messages.compilation_write,
2780
									Messages.compilation_write,
2776
									new String[] {
2781
									new String[] {
Lines 2810-2816 Link Here
2810
				getHandlingPolicy(),
2815
				getHandlingPolicy(),
2811
				this.options,
2816
				this.options,
2812
				getBatchRequestor(),
2817
				getBatchRequestor(),
2813
				getProblemFactory());
2818
				getProblemFactory(),
2819
				this.out);
2814
		this.compilerOptions = batchCompiler.options;
2820
		this.compilerOptions = batchCompiler.options;
2815
2821
2816
		// set the non-externally configurable options.
2822
		// set the non-externally configurable options.
(-)compiler/org/eclipse/jdt/internal/compiler/Compiler.java (-47 / +158 lines)
Lines 27-32 Link Here
27
	public ICompilerRequestor requestor;
27
	public ICompilerRequestor requestor;
28
	public CompilerOptions options;
28
	public CompilerOptions options;
29
	public ProblemReporter problemReporter;
29
	public ProblemReporter problemReporter;
30
	protected PrintWriter out; // output for messages that are not sent to problemReporter
30
31
31
	// management of unit to be processed
32
	// management of unit to be processed
32
	//public CompilationUnitResult currentCompilationUnitResult;
33
	//public CompilationUnitResult currentCompilationUnitResult;
Lines 83-115 Link Here
83
	 *      them back as part of the compilation unit result.
84
	 *      them back as part of the compilation unit result.
84
	 */
85
	 */
85
	public Compiler(
86
	public Compiler(
86
		INameEnvironment environment,
87
			INameEnvironment environment,
87
		IErrorHandlingPolicy policy,
88
			IErrorHandlingPolicy policy,
88
		Map settings,
89
			Map settings,
89
		final ICompilerRequestor requestor,
90
			final ICompilerRequestor requestor,
90
		IProblemFactory problemFactory) {
91
			IProblemFactory problemFactory) {
91
92
		this(environment, policy, settings,	requestor, problemFactory, 
92
		// create a problem handler given a handling policy
93
				null, false, false, false, false); // all defaults
93
		this.options = new CompilerOptions(settings);
94
	}
94
		
95
	
95
		// wrap requestor in DebugRequestor if one is specified
96
	/**
96
		if(DebugRequestor == null) {
97
	 * Answer a new compiler using the given name environment and compiler options.
97
			this.requestor = requestor;
98
	 * The environment and options will be in effect for the lifetime of the compiler.
98
		} else {
99
	 * When the compiler is run, compilation results are sent to the given requestor.
99
			this.requestor = new ICompilerRequestor(){
100
	 *
100
				public void acceptResult(CompilationResult result){
101
	 *  @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment
101
					if (DebugRequestor.isActive()){
102
	 *      Environment used by the compiler in order to resolve type and package
102
						DebugRequestor.acceptDebugResult(result);
103
	 *      names. The name environment implements the actual connection of the compiler
103
					}
104
	 *      to the outside world (e.g. in batch mode the name environment is performing
104
					requestor.acceptResult(result);
105
	 *      pure file accesses, reuse previous build state or connection to repositories).
105
				}
106
	 *      Note: the name environment is responsible for implementing the actual classpath
106
			};
107
	 *            rules.
107
		}
108
	 *
108
		this.problemReporter =
109
	 *  @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy
109
			new ProblemReporter(policy, this.options, problemFactory);
110
	 *      Configurable part for problem handling, allowing the compiler client to
110
		this.lookupEnvironment =
111
	 *      specify the rules for handling problems (stop on first error or accumulate
111
			new LookupEnvironment(this, this.options, this.problemReporter, environment);
112
	 *      them all) and at the same time perform some actions such as opening a dialog
112
		initializeParser();
113
	 *      in UI when compiling interactively.
114
	 *      @see org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies
115
	 *      
116
	 *  @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor
117
	 *      Component which will receive and persist all compilation results and is intended
118
	 *      to consume them as they are produced. Typically, in a batch compiler, it is 
119
	 *      responsible for writing out the actual .class files to the file system.
120
	 *      @see org.eclipse.jdt.internal.compiler.CompilationResult
121
	 *
122
	 *  @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory
123
	 *      Factory used inside the compiler to create problem descriptors. It allows the
124
	 *      compiler client to supply its own representation of compilation problems in
125
	 *      order to avoid object conversions. Note that the factory is not supposed
126
	 *      to accumulate the created problems, the compiler will gather them all and hand
127
	 *      them back as part of the compilation unit result.
128
	 *
129
	 *  @param out java.io.PrintWriter
130
	 *      Used by the compiler to output messages which are not related to problems,
131
	 *      e.g. the information issued in verbose mode. If null, defaults to System.out 
132
	 *      with automatic flushing. 
133
	 */
134
	public Compiler(
135
			INameEnvironment environment,
136
			IErrorHandlingPolicy policy,
137
			Map settings,
138
			final ICompilerRequestor requestor,
139
			IProblemFactory problemFactory,
140
			PrintWriter out) {
141
		this(environment, policy, settings,	requestor, problemFactory, out, 
142
				false, false, false, false); // all defaults
113
	}
143
	}
114
	
144
	
115
	/**
145
	/**
Lines 144-170 Link Here
144
	 *      order to avoid object conversions. Note that the factory is not supposed
174
	 *      order to avoid object conversions. Note that the factory is not supposed
145
	 *      to accumulate the created problems, the compiler will gather them all and hand
175
	 *      to accumulate the created problems, the compiler will gather them all and hand
146
	 *      them back as part of the compilation unit result.
176
	 *      them back as part of the compilation unit result.
177
	 *
147
	 *	@param parseLiteralExpressionsAsConstants <code>boolean</code>
178
	 *	@param parseLiteralExpressionsAsConstants <code>boolean</code>
148
	 *		This parameter is used to optimize the literals or leave them as they are in the source.
179
	 *		This parameter is used to optimize the literals or leave them as they are in the source.
149
	 * 		If you put true, "Hello" + " world" will be converted to "Hello world".
180
	 * 		If you put true, "Hello" + " world" will be converted to "Hello world".
181
	 *
182
	 *	@param storeAnnotations <code>boolean</code>
183
	 *		This parameter is used to tell the compiler to store annotations on 
184
	 *		type bindings, or not.
185
	 *
186
	 *	@param statementsRecovery <code>boolean</code>
187
	 *		This parameter is used to tell the compiler to perform syntax error
188
	 *      recovery on statements, or not. 
150
	 */
189
	 */
151
	public Compiler(
190
	public Compiler(
152
		INameEnvironment environment,
191
			INameEnvironment environment,
153
		IErrorHandlingPolicy policy,
192
			IErrorHandlingPolicy policy,
154
		Map settings,
193
			Map settings,
155
		final ICompilerRequestor requestor,
194
			final ICompilerRequestor requestor,
156
		IProblemFactory problemFactory,
195
			IProblemFactory problemFactory,
157
		boolean parseLiteralExpressionsAsConstants,
196
			boolean parseLiteralExpressionsAsConstants,
158
		boolean storeAnnotations,
197
			boolean storeAnnotations,
159
		boolean statementsRecovery) {
198
			boolean statementsRecovery) {
199
		this(environment, policy, settings,	requestor, problemFactory, 
200
				null, // default 
201
				parseLiteralExpressionsAsConstants, storeAnnotations, statementsRecovery, true);
202
	}
203
204
	/**
205
	 * Answer a new compiler using the given name environment and compiler options.
206
	 * The environment and options will be in effect for the lifetime of the compiler.
207
	 * When the compiler is run, compilation results are sent to the given requestor.
208
	 *
209
	 *  @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment
210
	 *      Environment used by the compiler in order to resolve type and package
211
	 *      names. The name environment implements the actual connection of the compiler
212
	 *      to the outside world (e.g. in batch mode the name environment is performing
213
	 *      pure file accesses, reuse previous build state or connection to repositories).
214
	 *      Note: the name environment is responsible for implementing the actual classpath
215
	 *            rules.
216
	 *
217
	 *  @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy
218
	 *      Configurable part for problem handling, allowing the compiler client to
219
	 *      specify the rules for handling problems (stop on first error or accumulate
220
	 *      them all) and at the same time perform some actions such as opening a dialog
221
	 *      in UI when compiling interactively.
222
	 *      @see org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies
223
	 *      
224
	 *  @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor
225
	 *      Component which will receive and persist all compilation results and is intended
226
	 *      to consume them as they are produced. Typically, in a batch compiler, it is 
227
	 *      responsible for writing out the actual .class files to the file system.
228
	 *      @see org.eclipse.jdt.internal.compiler.CompilationResult
229
	 *
230
	 *  @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory
231
	 *      Factory used inside the compiler to create problem descriptors. It allows the
232
	 *      compiler client to supply its own representation of compilation problems in
233
	 *      order to avoid object conversions. Note that the factory is not supposed
234
	 *      to accumulate the created problems, the compiler will gather them all and hand
235
	 *      them back as part of the compilation unit result.
236
	 *
237
	 *  @param out java.io.PrintWriter
238
	 *      Used by the compiler to output messages which are not related to problems,
239
	 *      e.g. the information issued in verbose mode. If null, defaults to System.out 
240
	 *      with automatic flushing. 
241
	 *
242
	 *	@param parseLiteralExpressionsAsConstants <code>boolean</code>
243
	 *		This parameter is used to optimize the literals or leave them as they are in the source.
244
	 * 		If you put true, "Hello" + " world" will be converted to "Hello world".
245
	 *
246
	 *	@param storeAnnotations <code>boolean</code>
247
	 *		This parameter is used to tell the compiler to store annotations on 
248
	 *		type bindings, or not.
249
	 *
250
	 *	@param statementsRecovery <code>boolean</code>
251
	 *		This parameter is used to tell the compiler to perform syntax error
252
	 *      recovery on statements, or not. 
253
	 *
254
	 *	@param flag <code>boolean</code>
255
	 *		Set to true if and only if the other boolean parameters are significant.
256
	 */
257
	private Compiler(
258
			INameEnvironment environment,
259
			IErrorHandlingPolicy policy,
260
			Map settings,
261
			final ICompilerRequestor requestor,
262
			IProblemFactory problemFactory,
263
			PrintWriter out,
264
			boolean parseLiteralExpressionsAsConstants,
265
			boolean storeAnnotations,
266
			boolean statementsRecovery,
267
			boolean flag) {
160
268
161
		// create a problem handler given a handling policy
269
		// create a problem handler given a handling policy
162
		this.options = new CompilerOptions(settings);
270
		this.options = new CompilerOptions(settings);
163
		this.options.parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants;
271
		if (flag) { // boolean parameters are significant, pass them down
164
		this.options.storeAnnotations = storeAnnotations;
272
			this.options.parseLiteralExpressionsAsConstants = parseLiteralExpressionsAsConstants;
165
		this.options.performStatementsRecovery =
273
			this.options.storeAnnotations = storeAnnotations;
166
			statementsRecovery &&
274
			this.options.performStatementsRecovery =
167
			this.options.performStatementsRecovery;// TODO temporary code to take into account the temporary JavaCore options
275
				statementsRecovery &&
276
				this.options.performStatementsRecovery;// TODO temporary code to take into account the temporary JavaCore options
277
		}
168
		
278
		
169
		// wrap requestor in DebugRequestor if one is specified
279
		// wrap requestor in DebugRequestor if one is specified
170
		if(DebugRequestor == null) {
280
		if(DebugRequestor == null) {
Lines 181-186 Link Here
181
		}
291
		}
182
		this.problemReporter = new ProblemReporter(policy, this.options, problemFactory);
292
		this.problemReporter = new ProblemReporter(policy, this.options, problemFactory);
183
		this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, environment);
293
		this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, environment);
294
		this.out = out == null ? new PrintWriter(System.out, true) : out;
184
		initializeParser();
295
		initializeParser();
185
	}
296
	}
186
	
297
	
Lines 189-195 Link Here
189
	 */
300
	 */
190
	public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
301
	public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) {
191
		if (this.options.verbose) {
302
		if (this.options.verbose) {
192
			System.out.println(
303
			this.out.println(
193
				Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName())));
304
				Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName())));
194
//			new Exception("TRACE BINARY").printStackTrace(System.out);
305
//			new Exception("TRACE BINARY").printStackTrace(System.out);
195
//		    System.out.println();
306
//		    System.out.println();
Lines 208-214 Link Here
208
		try {
319
		try {
209
			if (options.verbose) {
320
			if (options.verbose) {
210
				String count = String.valueOf(totalUnits + 1);
321
				String count = String.valueOf(totalUnits + 1);
211
				System.out.println(
322
				this.out.println(
212
					Messages.bind(Messages.compilation_request,
323
					Messages.bind(Messages.compilation_request,
213
						new String[] {
324
						new String[] {
214
							count,
325
							count,
Lines 281-287 Link Here
281
				new CompilationResult(sourceUnits[i], i, maxUnits, this.options.maxProblemsPerUnit);
392
				new CompilationResult(sourceUnits[i], i, maxUnits, this.options.maxProblemsPerUnit);
282
			try {
393
			try {
283
				if (options.verbose) {
394
				if (options.verbose) {
284
					System.out.println(
395
					this.out.println(
285
						Messages.bind(Messages.compilation_request,
396
						Messages.bind(Messages.compilation_request,
286
						new String[] {
397
						new String[] {
287
							String.valueOf(i + 1),
398
							String.valueOf(i + 1),
Lines 326-332 Link Here
326
				unit = unitsToProcess[i];
437
				unit = unitsToProcess[i];
327
				try {
438
				try {
328
					if (options.verbose)
439
					if (options.verbose)
329
						System.out.println(
440
						this.out.println(
330
							Messages.bind(Messages.compilation_process,
441
							Messages.bind(Messages.compilation_process,
331
							new String[] {
442
							new String[] {
332
								String.valueOf(i + 1),
443
								String.valueOf(i + 1),
Lines 341-347 Link Here
341
				unitsToProcess[i] = null; // release reference to processed unit declaration
452
				unitsToProcess[i] = null; // release reference to processed unit declaration
342
				requestor.acceptResult(unit.compilationResult.tagAsAccepted());
453
				requestor.acceptResult(unit.compilationResult.tagAsAccepted());
343
				if (options.verbose)
454
				if (options.verbose)
344
					System.out.println(
455
					this.out.println(
345
						Messages.bind(Messages.compilation_done,
456
						Messages.bind(Messages.compilation_done,
346
						new String[] {
457
						new String[] {
347
							String.valueOf(i + 1),
458
							String.valueOf(i + 1),
Lines 362-371 Link Here
362
		}
473
		}
363
		if (options.verbose) {
474
		if (options.verbose) {
364
			if (this.totalUnits > 1) {
475
			if (this.totalUnits > 1) {
365
				System.out.println(
476
				this.out.println(
366
					Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits))); 
477
					Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits))); 
367
			} else {
478
			} else {
368
				System.out.println(
479
				this.out.println(
369
					Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits))); 
480
					Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits))); 
370
			}
481
			}
371
		}
482
		}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-227 / +351 lines)
Lines 618-624 Link Here
618
			result);
618
			result);
619
}
619
}
620
// test the tester - runConformTest
620
// test the tester - runConformTest
621
public void _test007(){
621
public void test007(){
622
	this.runConformTest(
622
	this.runConformTest(
623
		new String[] {
623
		new String[] {
624
			"X.java",
624
			"X.java",
Lines 640-659 Link Here
640
        + " -1.5 -g -preserveAllLocals"
640
        + " -1.5 -g -preserveAllLocals"
641
        + " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar"
641
        + " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar"
642
        + " -cp " + JRE_HOME_DIR + "/lib/jce.jar"
642
        + " -cp " + JRE_HOME_DIR + "/lib/jce.jar"
643
        + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
643
        + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
644
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
644
        + " -verbose -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
645
        "[1 .class file generated]\n", 
645
        "[parsing    ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
646
        "----------\n" + 
646
		"[reading    java/lang/Object.class]\n" + 
647
        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
647
		"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
648
        " (at line 1)\n" + 
648
		"[reading    java/util/List.class]\n" + 
649
        "	import java.util.List;\n" + 
649
		"[reading    java/lang/SuppressWarnings.class]\n" + 
650
        "	       ^^^^^^^^^^^^^^\n" + 
650
		"[reading    java/lang/String.class]\n" + 
651
        "The import java.util.List is never used\n" + 
651
		"[writing    X.class - #1]\n" + 
652
        "----------\n" + 
652
		"[completed  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
653
        "1 problem (1 warning)", true);
653
		"[1 unit compiled]\n" + 
654
		"[1 .class file generated]\n", 
655
        "", // changed with bug 123522: now the SuppressWarning upon the first type 
656
        	// influences warnings on unused imports
657
        true);
654
}
658
}
655
// test the tester - runNegativeTest
659
// test the tester - runNegativeTest
656
public void _test008(){
660
public void test008(){
657
	this.runNegativeTest(
661
	this.runNegativeTest(
658
		new String[] {
662
		new String[] {
659
			"X.java",
663
			"X.java",
Lines 675-683 Link Here
675
        + " -1.5 -g -preserveAllLocals"
679
        + " -1.5 -g -preserveAllLocals"
676
        + " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar"
680
        + " -bootclasspath " + JRE_HOME_DIR + "/lib/rt.jar"
677
        + " -cp " + JRE_HOME_DIR + "/lib/jce.jar"
681
        + " -cp " + JRE_HOME_DIR + "/lib/jce.jar"
678
        + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
682
        + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
679
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
683
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
680
        "[1 .class file generated]\n", 
684
        "", 
681
        "----------\n" + 
685
        "----------\n" + 
682
        "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
686
        "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
683
        " (at line 11)\n" + 
687
        " (at line 11)\n" + 
Lines 689-695 Link Here
689
}
693
}
690
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not
694
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92398 -- a case that works, another that does not
691
// revisit this test case depending on https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349
695
// revisit this test case depending on https://bugs.eclipse.org/bugs/show_bug.cgi?id=95349
692
public void _test009(){
696
public void test009(){
693
	this.runNegativeTest(
697
	this.runNegativeTest(
694
		new String[] {
698
		new String[] {
695
			"X.java",
699
			"X.java",
Lines 726-760 Link Here
726
        + " -1.5 -g -preserveAllLocals"
730
        + " -1.5 -g -preserveAllLocals"
727
        + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" 
731
        + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" 
728
        	+ File.pathSeparator + "-KO]\""
732
        	+ File.pathSeparator + "-KO]\""
729
        + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
733
        + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
730
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
734
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
731
        "[5 .class files generated]\n", 
735
        "", 
732
        "----------\n" + 
736
		"----------\n" + 
733
        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
737
		"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + 
734
        " (at line 5)\n" + 
738
		" (at line 5)\n" + 
735
        "	Warn warn;\n" + 
739
		"	Warn warn;\n" + 
736
        "	^^^^\n" + 
740
		"	^^^^\n" + 
737
        "Discouraged access: Warn\n" + 
741
		"Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + 
738
        "----------\n" + 
742
		"----------\n" + 
739
        "----------\n" + 
743
		"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + 
740
        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
744
		" (at line 6)\n" + 
741
        " (at line 6)\n" + 
745
		"	KO ko;\n" + 
742
        "	KO ko;\n" + 
746
		"	^^\n" + 
743
        "	^^\n" + 
747
		"Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + 
744
        "Access restriction: KO\n" + 
748
		"----------\n" + 
745
        "----------\n" + 
749
		"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + 
746
        "----------\n" + 
750
		" (at line 7)\n" + 
747
        "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
751
		"	Zork z;\n" + 
748
        " (at line 7)\n" + 
752
		"	^^^^\n" + 
749
        "	Zork z;\n" + 
753
		"Zork cannot be resolved to a type\n" + 
750
        "	^^^^\n" + 
754
		"----------\n" + 
751
        "Zork cannot be resolved to a type\n" + 
755
		"3 problems (1 error, 2 warnings)",
752
        "----------\n" + 
753
        "3 problems (1 error, 2 warnings)",
754
        true);
756
        true);
755
}
757
}
756
// command line - no user classpath nor bootclasspath
758
// command line - no user classpath nor bootclasspath
757
public void _test010(){
759
public void test010(){
758
	this.runConformTest(
760
	this.runConformTest(
759
		new String[] {
761
		new String[] {
760
			"X.java",
762
			"X.java",
Lines 776-790 Link Here
776
        + " -1.5 -g -preserveAllLocals"
778
        + " -1.5 -g -preserveAllLocals"
777
        + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
779
        + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal"
778
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
780
        + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
779
        "[1 .class file generated]\n", 
781
        "[parsing    ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
780
        "----------\n" + 
782
		"[reading    java/lang/Object.class]\n" + 
781
        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
783
		"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
782
        " (at line 1)\n" + 
784
		"[reading    java/util/List.class]\n" + 
783
        "	import java.util.List;\n" + 
785
		"[reading    java/lang/SuppressWarnings.class]\n" + 
784
        "	       ^^^^^^^^^^^^^^\n" + 
786
		"[reading    java/lang/String.class]\n" + 
785
        "The import java.util.List is never used\n" + 
787
		"[writing    X.class - #1]\n" + 
786
        "----------\n" + 
788
		"[completed  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
787
        "1 problem (1 warning)", true);
789
		"[1 unit compiled]\n" + 
790
		"[1 .class file generated]\n", 
791
        "", 
792
        true);
788
}
793
}
789
// command line - unusual classpath (ends with ';', still OK)
794
// command line - unusual classpath (ends with ';', still OK)
790
public void test011(){
795
public void test011(){
Lines 805-945 Link Here
805
        true);
810
        true);
806
}
811
}
807
// command line - help
812
// command line - help
808
public void _test012(){
813
public void test012(){
809
	final String expectedOutput =
814
	final String expectedOutput =
810
        "{0}\n" + 
815
        "{0}\n" + 
811
        " \n" + 
816
		" \n" + 
812
        " Usage: <options> <source files | directories>\n" + 
817
		" Usage: <options> <source files | directories>\n" + 
813
        " If directories are specified, then their source contents are compiled.\n" + 
818
		" If directories are specified, then their source contents are compiled.\n" + 
814
        " Possible options are listed below. Options enabled by default are prefixed with \'\'+\'\'\n" + 
819
		" Possible options are listed below. Options enabled by default are prefixed with ''+''\n" + 
815
        " \n" + 
820
		" \n" + 
816
        " Classpath options:\n" + 
821
		" Classpath options:\n" + 
817
        "    -cp -classpath <directories and zip/jar files separated by {1}>\n" + 
822
		"    -cp -classpath <directories and zip/jar files separated by :>\n" + 
818
        "                       specify location for application classes and sources. Each\n" + 
823
		"                       specify location for application classes and sources. Each\n" + 
819
        "                       directory or file can specify access rules for types between\n" + 
824
		"                       directory or file can specify access rules for types between\n" + 
820
        "                       \'\'[\'\' and \'\']\'\' (e.g. [-X.java] to deny access to type X)\n" + 
825
		"                       ''['' and '']'' (e.g. [-X] to forbid access to type X, [~X] to\n" + 
821
        "    -bootclasspath <directories and zip/jar files separated by {1}>\n" + 
826
		"                       discourage access to type X, [+p/X:-p/*] to forbid access to all\n" + 
822
        "                       specify location for system classes. Each directory or file can\n" + 
827
		"                       types in package p but allow access to p/X)\n" + 
823
        "                       specify access rules for types between \'\'[\'\' and \'\']\'\' (e.g. [-X.java]\n" + 
828
		"    -bootclasspath <directories and zip/jar files separated by :>\n" + 
824
        "                       to deny access to type X)\n" + 
829
		"                       specify location for system classes. Each directory or file can\n" + 
825
        "    -sourcepath <directories and zip/jar files separated by {1}>\n" + 
830
		"                       specify access rules for types between ''['' and '']''\n" + 
826
        "                       specify location for application sources. Each directory or file can\n" + 
831
		"    -sourcepath <directories separated by :>\n" + 
827
        "                       specify access rules for types between \'\'[\'\' and \'\']\'\' (e.g. [-X.java]\n" + 
832
		"                       specify location for application sources. Each directory can\n" + 
828
        "                       to deny access to type X)\n" + 
833
		"                       specify access rules for types between ''['' and '']''\n" + 
829
        "    -extdirs <directories separated by {1}>\n" + 
834
		"    -extdirs <directories separated by :>\n" + 
830
        "                       specify location for extension zip/jar files\n" + 
835
		"                       specify location for extension zip/jar files\n" + 
831
        "    -d <dir>           destination directory (if omitted, no directory is created)\n" + 
836
		"    -d <dir>           destination directory (if omitted, no directory is created)\n" + 
832
        "    -d none            generate no .class files\n" + 
837
		"    -d none            generate no .class files\n" + 
833
        "    -encoding <enc>    specify custom encoding for all sources. Each file/directory can override it\n" + 
838
		"    -encoding <enc>    specify custom encoding for all sources. Each file/directory can override it\n" + 
834
        "                       when suffixed with \'\'[\'\'<enc>\'\']\'\' (e.g. X.java[utf8])\n" + 
839
		"                       when suffixed with ''[''<enc>'']'' (e.g. X.java[utf8])\n" + 
835
        " \n" + 
840
		" \n" + 
836
        " Compliance options:\n" + 
841
		" Compliance options:\n" + 
837
        "    -1.3               use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n" + 
842
		"    -1.3               use 1.3 compliance level (implicit -source 1.3 -target 1.1)\n" + 
838
        "    -1.4             + use 1.4 compliance level (implicit -source 1.3 -target 1.2)\n" + 
843
		"    -1.4             + use 1.4 compliance level (implicit -source 1.3 -target 1.2)\n" + 
839
        "    -1.5               use 1.5 compliance level (implicit -source 1.5 -target 1.5)\n" + 
844
		"    -1.5               use 1.5 compliance level (implicit -source 1.5 -target 1.5)\n" + 
840
        "    -source <version>  set source level: 1.3 to 1.5 (or 5 or 5.0)\n" + 
845
		"    -1.6               use 1.6 compliance level (implicit -source 1.6 -target 1.6)\n" + 
841
        "    -target <version>  set classfile target level: 1.1 to 1.5 (or 5 or 5.0)\n" + 
846
		"    -source <version>  set source level: 1.3 to 1.6 (or 6 or 6.0)\n" + 
842
        " \n" + 
847
		"    -target <version>  set classfile target level: 1.1 to 1.6 (or 6 or 6.0)\n" + 
843
        " Warning options:\n" + 
848
		" \n" + 
844
        "    -deprecation     + deprecation outside deprecated code\n" + 
849
		" Warning options:\n" + 
845
        "    -nowarn            disable all warnings\n" + 
850
		"    -deprecation     + deprecation outside deprecated code\n" + 
846
        "    -warn:none         disable all warnings\n" + 
851
		"    -nowarn            disable all warnings\n" + 
847
        "    -warn:<warnings separated by ,>    enable exactly the listed warnings\n" + 
852
		"    -warn:none         disable all warnings\n" + 
848
        "    -warn:+<warnings separated by ,>   enable additional warnings\n" + 
853
		"    -warn:<warnings separated by ,>    enable exactly the listed warnings\n" + 
849
        "    -warn:-<warnings separated by ,>   disable specific warnings\n" + 
854
		"    -warn:+<warnings separated by ,>   enable additional warnings\n" + 
850
        "      allDeprecation       deprecation including inside deprecated code\n" + 
855
		"    -warn:-<warnings separated by ,>   disable specific warnings\n" + 
851
        "      allJavadoc           invalid or missing javadoc\n" + 
856
		"      allDeprecation       deprecation including inside deprecated code\n" + 
852
        "      assertIdentifier   + \'\'assert\'\' used as identifier\n" + 
857
		"      allJavadoc           invalid or missing javadoc\n" + 
853
        "      boxing               autoboxing conversion\n" + 
858
		"      assertIdentifier   + ''assert'' used as identifier\n" + 
854
        "      charConcat         + char[] in String concat\n" + 
859
		"      boxing               autoboxing conversion\n" + 
855
        "      conditionAssign      possible accidental boolean assignment\n" + 
860
		"      charConcat         + char[] in String concat\n" + 
856
        "      constructorName    + method with constructor name\n" + 
861
		"      conditionAssign      possible accidental boolean assignment\n" + 
857
        "      dep-ann              missing @Deprecated annotation\n" + 
862
		"      constructorName    + method with constructor name\n" + 
858
        "      deprecation        + deprecation outside deprecated code\n" + 
863
		"      dep-ann              missing @Deprecated annotation\n" + 
859
        "      emptyBlock           undocumented empty block\n" + 
864
		"      deprecation        + deprecation outside deprecated code\n" + 
860
        "      enumSwitch           incomplete enum switch\n" + 
865
		"      discouraged        + use of types matching a discouraged access rule\n" + 
861
        "      fieldHiding          field hiding another variable\n" + 
866
		"      emptyBlock           undocumented empty block\n" + 
862
        "      finalBound           type parameter with final bound\n" + 
867
		"      enumSwitch           incomplete enum switch\n" + 
863
        "      finally            + finally block not completing normally\n" + 
868
		"      fieldHiding          field hiding another variable\n" + 
864
        "      indirectStatic       indirect reference to static member\n" + 
869
		"      finalBound           type parameter with final bound\n" + 
865
        "      intfAnnotation     + annotation type used as super interface\n" + 
870
		"      finally            + finally block not completing normally\n" + 
866
        "      intfNonInherited   + interface non-inherited method compatibility\n" + 
871
		"      forbidden          + use of types matching a forbidden access rule\n" + 
867
        "      javadoc              invalid javadoc\n" + 
872
		"      hiding               macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock\n" + 
868
        "      localHiding          local variable hiding another variable\n" + 
873
		"      incomplete-switch    same as enumSwitch\n" + 
869
        "      maskedCatchBlock   + hidden catch block\n" + 
874
		"      indirectStatic       indirect reference to static member\n" + 
870
        "      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$\n" + 
875
		"      intfAnnotation     + annotation type used as super interface\n" + 
871
        "      noEffectAssign     + assignment without effect\n" + 
876
		"      intfNonInherited   + interface non-inherited method compatibility\n" + 
872
        "      null                 missing or redundant null check\n" + 
877
		"      javadoc              invalid javadoc\n" + 
873
        "      over-ann             missing @Override annotation\n" + 
878
		"      localHiding          local variable hiding another variable\n" + 
874
        "      pkgDefaultMethod   + attempt to override package-default method\n" + 
879
		"      maskedCatchBlock   + hidden catch block\n" + 
875
        "      semicolon            unnecessary semicolon, empty statement\n" + 
880
		"      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$\n" + 
876
        "      serial             + missing serialVersionUID\n" + 
881
		"      noEffectAssign     + assignment without effect\n" + 
877
        "      suppress           + enable @SuppressWarnings\n" + 
882
		"      null                 missing or redundant null check\n" + 
878
        "      unqualifiedField     unqualified reference to field\n" + 
883
		"      over-ann             missing @Override annotation\n" + 
879
        "      unchecked          + unchecked type operation\n" + 
884
		"      paramAssign          assignment to a parameter\n" + 
880
        "      unusedArgument       unread method parameter\n" + 
885
		"      pkgDefaultMethod   + attempt to override package-default method\n" + 
881
        "      unusedImport       + unused import declaration\n" + 
886
		"      raw                  usage of raw type\n" + 
882
        "      unusedLocal          unread local variable\n" + 
887
		"      semicolon            unnecessary semicolon, empty statement\n" + 
883
        "      unusedPrivate        unused private member declaration\n" + 
888
		"      serial             + missing serialVersionUID\n" + 
884
        "      unusedThrown         unused declared thrown exception\n" + 
889
		"      specialParamHiding   constructor or setter parameter hiding another field\n" + 
885
        "      unnecessaryElse      unnecessary else clause\n" + 
890
		"      static-access        macro for indirectStatic and staticReceiver\n" + 
886
        "      uselessTypeCheck     unnecessary cast/instanceof operation\n" + 
891
		"      staticReceiver     + non-static reference to static member\n" + 
887
        "      specialParamHiding   constructor or setter parameter hiding another field\n" + 
892
		"      suppress           + enable @SuppressWarnings\n" + 
888
        "      staticReceiver     + non-static reference to static member\n" + 
893
		"      synthetic-access     same as syntheticAccess\n" + 
889
        "      syntheticAccess      synthetic access for innerclass\n" + 
894
		"      syntheticAccess      synthetic access for innerclass\n" + 
890
        "      tasks(<tags separated by |>) tasks identified by tags inside comments\n" + 
895
		"      tasks(<tags separated by |>) tasks identified by tags inside comments\n" + 
891
        "      typeHiding         + type parameter hiding another type\n" + 
896
		"      typeHiding         + type parameter hiding another type\n" + 
892
        "      varargsCast        + varargs argument need explicit cast\n" + 
897
		"      unchecked          + unchecked type operation\n" + 
893
        "      warningToken       + unhandled warning token in @SuppressWarnings\n" + 
898
		"      unnecessaryElse      unnecessary else clause\n" + 
894
        " \n" + 
899
		"      unqualified-field-access same as unQualifiedField\n" + 
895
        " Debug options:\n" + 
900
		"      unqualifiedField     unqualified reference to field\n" + 
896
        "    -g[:lines,vars,source] custom debug info\n" + 
901
		"      unused               macro for unusedArgument, unusedImport, unusedLabel,\n" + 
897
        "    -g:lines,source  + both lines table and source debug info\n" + 
902
		"                               unusedLocal, unusedPrivate and unusedThrown\n" + 
898
        "    -g                 all debug info\n" + 
903
		"      unusedArgument       unread method parameter\n" + 
899
        "    -g:none            no debug info\n" + 
904
		"      unusedImport       + unused import declaration\n" + 
900
        "    -preserveAllLocals preserve unused local vars for debug purpose\n" + 
905
		"      unusedLabel        + unused label\n" + 
901
        " \n" + 
906
		"      unusedLocal        + unread local variable\n" + 
902
        " Ignored options:\n" + 
907
		"      unusedPrivate      + unused private member declaration\n" + 
903
        "    -J<option>         pass option to virtual machine (ignored)\n" + 
908
		"      unusedThrown         unused declared thrown exception\n" + 
904
        "    -X<option>         specify non-standard option (ignored)\n" + 
909
		"      uselessTypeCheck     unnecessary cast/instanceof operation\n" + 
905
        "    -X                 print non-standard options and exit (ignored)\n" + 
910
		"      varargsCast        + varargs argument need explicit cast\n" + 
906
        "    -O                 optimize for execution time (ignored)\n" + 
911
		"      warningToken       + unhandled warning token in @SuppressWarnings\n" + 
907
        " \n" + 
912
		" \n" + 
908
        " Advanced options:\n" + 
913
		" Debug options:\n" + 
909
        "    @<file>            read command line arguments from file\n" + 
914
		"    -g[:lines,vars,source] custom debug info\n" + 
910
        "    -maxProblems <n>   max number of problems per compilation unit (100 by default)\n" + 
915
		"    -g:lines,source  + both lines table and source debug info\n" + 
911
        "    -log <file>        log to a file\n" + 
916
		"    -g                 all debug info\n" + 
912
        "    -proceedOnError    do not stop at first error, dumping class files with problem methods\n" + 
917
		"    -g:none            no debug info\n" + 
913
        "    -verbose           enable verbose output\n" + 
918
		"    -preserveAllLocals preserve unused local vars for debug purpose\n" + 
914
        "    -referenceInfo     compute reference info\n" + 
919
		" \n" + 
915
        "    -progress          show progress (only in -log mode)\n" + 
920
		" Ignored options:\n" + 
916
        "    -time              display speed information \n" + 
921
		"    -J<option>         pass option to virtual machine (ignored)\n" + 
917
        "    -noExit            do not call System.exit(n) at end of compilation (n==0 if no error)\n" + 
922
		"    -X<option>         specify non-standard option (ignored)\n" + 
918
        "    -repeat <n>        repeat compilation process <n> times for perf analysis\n" + 
923
		"    -X                 print non-standard options and exit (ignored)\n" + 
919
        "    -inlineJSR         inline JSR bytecode (implicit if target >= 1.5)\n" + 
924
		"    -O                 optimize for execution time (ignored)\n" + 
920
        "    -enableJavadoc     consider references in javadoc\n" + 
925
		" \n" + 
921
        " \n" + 
926
		" Advanced options:\n" + 
922
        "    -? -help           print this help message\n" + 
927
		"    @<file>            read command line arguments from file\n" + 
923
        "    -v -version        print compiler version\n" + 
928
		"    -maxProblems <n>   max number of problems per compilation unit (100 by default)\n" + 
924
        "    -showversion       print compiler version and continue\n" + 
929
		"    -log <file>        log to a file. If the file extension is ''.xml'', then the log\n" + 
925
        "\n";
930
		"                       will be a xml file.\n" + 
931
		"    -proceedOnError    do not stop at first error, dumping class files with problem methods\n" + 
932
		"    -verbose           enable verbose output\n" + 
933
		"    -referenceInfo     compute reference info\n" + 
934
		"    -progress          show progress (only in -log mode)\n" + 
935
		"    -time              display speed information \n" + 
936
		"    -noExit            do not call System.exit(n) at end of compilation (n==0 if no error)\n" + 
937
		"    -repeat <n>        repeat compilation process <n> times for perf analysis\n" + 
938
		"    -inlineJSR         inline JSR bytecode (implicit if target >= 1.5)\n" + 
939
		"    -enableJavadoc     consider references in javadoc\n" + 
940
		" \n" + 
941
		"    -? -help           print this help message\n" + 
942
		"    -v -version        print compiler version\n" + 
943
		"    -showversion       print compiler version and continue\n" + 
944
		"\n";
926
945
927
	this.runConformTest(
946
	this.runConformTest(
928
		new String[0],
947
		new String[0],
929
        " -help -showversion -referenceInfo",
948
        " -help -referenceInfo",
930
		MessageFormat.format(expectedOutput, new String[] {
949
		MessageFormat.format(expectedOutput, new String[] {
931
				Main.bind("misc.version", new String[] {
950
				Main.bind("misc.version", new String[] {
932
					Main.bind("compiler.name"),
951
					Main.bind("compiler.name"),
933
					Main.bind("compiler.version"),
952
					Main.bind("compiler.version"),
934
					Main.bind("compiler.copyright")
953
					Main.bind("compiler.copyright")
935
				}),
954
				}),
936
				File.pathSeparator
955
				// File.pathSeparator
937
		}),
956
		}),
938
        "", true);
957
        "", true);
939
}
958
}
940
959
941
	// command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904
960
	// command line - xml log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904
942
	public void _test013() {
961
	public void test013() {
943
		String logFileName = OUTPUT_DIR + File.separator + "log.xml";
962
		String logFileName = OUTPUT_DIR + File.separator + "log.xml";
944
		this.runNegativeTest(new String[] { 
963
		this.runNegativeTest(new String[] { 
945
				"X.java",
964
				"X.java",
Lines 963-970 Link Here
963
		String logContents = Util.fileContent(logFileName);
982
		String logContents = Util.fileContent(logFileName);
964
		String expectedLogContents = 
983
		String expectedLogContents = 
965
			"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 
984
			"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 
966
			"<!DOCTYPE compiler SYSTEM \"compiler.dtd\">\n" + 
985
			"<!DOCTYPE compiler PUBLIC \"-//Eclipse.org//DTD Eclipse JDT 3.2.001 Compiler//EN\" \"http://www.eclipse.org/jdt/core/compiler_32_001.dtd\">\n" + 
967
			"<compiler name=\"Eclipse Java Compiler\" copyright=\"Copyright IBM Corp 2000, 2005. All rights reserved.\" version=\"{1}\">\n" + 
986
			"<compiler name=\"{1}\" copyright=\"{2}\" version=\"{3}\">\n" + 
968
			"	<command_line>\n" + 
987
			"	<command_line>\n" + 
969
			"		<argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + 
988
			"		<argument value=\"---OUTPUT_DIR_PLACEHOLDER---{0}X.java\"/>\n" + 
970
			"		<argument value=\"-1.5\"/>\n" + 
989
			"		<argument value=\"-1.5\"/>\n" + 
Lines 993-998 Link Here
993
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + 
1012
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.discouragedReference\" value=\"warning\"/>\n" + 
994
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" + 
1013
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.emptyStatement\" value=\"ignore\"/>\n" + 
995
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + 
1014
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.enumIdentifier\" value=\"warning\"/>\n" + 
1015
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.fatalOptionalError\" value=\"enabled\"/>\n" + 
996
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" + 
1016
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.fieldHiding\" value=\"ignore\"/>\n" + 
997
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" + 
1017
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.finalParameterBound\" value=\"warning\"/>\n" + 
998
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + 
1018
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally\" value=\"warning\"/>\n" + 
Lines 1002-1011 Link Here
1002
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + 
1022
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch\" value=\"ignore\"/>\n" + 
1003
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + 
1023
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.indirectStaticAccess\" value=\"ignore\"/>\n" + 
1004
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" + 
1024
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadoc\" value=\"ignore\"/>\n" + 
1005
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"enabled\"/>\n" + 
1025
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTags\" value=\"disabled\"/>\n" + 
1006
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"enabled\"/>\n" + 
1026
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef\" value=\"disabled\"/>\n" + 
1007
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"enabled\"/>\n" + 
1027
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef\" value=\"disabled\"/>\n" + 
1008
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"private\"/>\n" + 
1028
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility\" value=\"public\"/>\n" + 
1009
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" + 
1029
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.localVariableHiding\" value=\"ignore\"/>\n" + 
1010
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" + 
1030
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.methodWithConstructorName\" value=\"warning\"/>\n" + 
1011
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation\" value=\"ignore\"/>\n" + 
1031
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation\" value=\"ignore\"/>\n" + 
Lines 1014-1020 Link Here
1014
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" + 
1034
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility\" value=\"public\"/>\n" + 
1015
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" + 
1035
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTags\" value=\"ignore\"/>\n" + 
1016
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" + 
1036
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding\" value=\"disabled\"/>\n" + 
1017
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"private\"/>\n" + 
1037
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility\" value=\"public\"/>\n" + 
1018
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" + 
1038
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation\" value=\"ignore\"/>\n" + 
1019
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" + 
1039
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.missingSerialVersion\" value=\"warning\"/>\n" + 
1020
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" + 
1040
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.noEffectAssignment\" value=\"warning\"/>\n" + 
Lines 1022-1028 Link Here
1022
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" + 
1042
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral\" value=\"ignore\"/>\n" + 
1023
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"ignore\"/>\n" + 
1043
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.nullReference\" value=\"ignore\"/>\n" + 
1024
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + 
1044
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod\" value=\"warning\"/>\n" + 
1045
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" + 
1025
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + 
1046
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" + 
1047
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"ignore\"/>\n" + 
1026
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
1048
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" + 
1027
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
1049
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" + 
1028
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + 
1050
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.suppressWarnings\" value=\"enabled\"/>\n" + 
Lines 1037-1047 Link Here
1037
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" + 
1059
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException\" value=\"ignore\"/>\n" + 
1038
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" + 
1060
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding\" value=\"disabled\"/>\n" + 
1039
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" + 
1061
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedImport\" value=\"warning\"/>\n" + 
1040
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"ignore\"/>\n" + 
1062
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedLabel\" value=\"warning\"/>\n" + 
1063
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedLocal\" value=\"warning\"/>\n" + 
1041
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" + 
1064
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameter\" value=\"ignore\"/>\n" + 
1042
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" + 
1065
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract\" value=\"disabled\"/>\n" + 
1043
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" + 
1066
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete\" value=\"disabled\"/>\n" + 
1044
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"ignore\"/>\n" + 
1067
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.unusedPrivateMember\" value=\"warning\"/>\n" + 
1045
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" + 
1068
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast\" value=\"warning\"/>\n" + 
1046
			"		<option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" + 
1069
			"		<option key=\"org.eclipse.jdt.core.compiler.source\" value=\"1.5\"/>\n" + 
1047
			"		<option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" + 
1070
			"		<option key=\"org.eclipse.jdt.core.compiler.taskCaseSensitive\" value=\"enabled\"/>\n" + 
Lines 1067-1080 Link Here
1067
			"		<problem_summary problems=\"1\" errors=\"1\" warnings=\"0\" tasks=\"0\"/>\n" + 
1090
			"		<problem_summary problems=\"1\" errors=\"1\" warnings=\"0\" tasks=\"0\"/>\n" + 
1068
			"	</stats>\n" + 
1091
			"	</stats>\n" + 
1069
			"</compiler>\n";
1092
			"</compiler>\n";
1070
		boolean compareOK = semiNormalizedComparison(
1093
		String normalizedExpectedLogContents =
1071
				MessageFormat.format(
1094
				MessageFormat.format(
1072
						expectedLogContents,
1095
						expectedLogContents,
1073
						new String[] {
1096
						new String[] {
1074
								File.separator,
1097
								File.separator,
1098
								Main.bind("compiler.name"),
1099
								Main.bind("compiler.copyright"),
1075
								Main.bind("compiler.version")
1100
								Main.bind("compiler.version")
1076
						}),
1101
						});
1077
				logContents, xmlLogsNormalizer);
1102
		String normalizedLogContents =
1103
				xmlLogsNormalizer.normalized(logContents);
1104
		boolean compareOK = normalizedExpectedLogContents.equals(
1105
				normalizedLogContents);
1078
		if (!compareOK) {
1106
		if (!compareOK) {
1079
			System.out.println(getClass().getName() + '#' + getName());
1107
			System.out.println(getClass().getName() + '#' + getName());
1080
			System.out.println(
1108
			System.out.println(
Lines 1086-1093 Link Here
1086
				  + "\n--------- (cut and paste:) ----------\n"
1114
				  + "\n--------- (cut and paste:) ----------\n"
1087
					+ Util.displayString(xmlLogsNormalizer.normalized(logContents))
1115
					+ Util.displayString(xmlLogsNormalizer.normalized(logContents))
1088
				  + "\n------------- [END LOG] -------------\n");
1116
				  + "\n------------- [END LOG] -------------\n");
1117
			assertEquals("Unexpected log contents", 
1118
					normalizedExpectedLogContents, normalizedLogContents);
1089
		}
1119
		}
1090
		assertTrue("unexpected log contents", compareOK);
1091
	}
1120
	}
1092
1121
1093
	// command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904
1122
	// command line - txt log contents https://bugs.eclipse.org/bugs/show_bug.cgi?id=93904
Lines 1187-1193 Link Here
1187
		}
1216
		}
1188
		assertTrue("unexpected log contents", compareOK);
1217
		assertTrue("unexpected log contents", compareOK);
1189
	}
1218
	}
1190
public void _test016(){
1219
public void test016(){
1191
		this.runConformTest(
1220
		this.runConformTest(
1192
			new String[] {
1221
			new String[] {
1193
					"X.java",
1222
					"X.java",
Lines 1206-1216 Link Here
1206
	        + " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\""
1235
	        + " -cp ." + File.pathSeparator + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\""
1207
	        + " -verbose -proceedOnError -referenceInfo"
1236
	        + " -verbose -proceedOnError -referenceInfo"
1208
	        + " -d \"" + OUTPUT_DIR + "\"",
1237
	        + " -d \"" + OUTPUT_DIR + "\"",
1209
	        "[2 .class files generated]\n",
1238
			"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
1239
			"[reading    java/lang/Object.class]\n" + 
1240
			"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
1241
			"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + 
1242
			"[writing    X.class - #1]\n" + 
1243
			"[completed  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/2]\n" + 
1244
			"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + 
1245
			"[writing    OK1.class - #2]\n" + 
1246
			"[completed  ---OUTPUT_DIR_PLACEHOLDER---/OK1.java - #2/2]\n" + 
1247
			"[2 units compiled]\n" + 
1248
			"[2 .class files generated]\n",
1210
	        "",
1249
	        "",
1211
	        true);
1250
	        true);
1212
	}
1251
	}
1213
public void _test017(){
1252
public void test017(){
1214
		this.runConformTest(
1253
		this.runConformTest(
1215
			new String[] {
1254
			new String[] {
1216
					"X.java",
1255
					"X.java",
Lines 1227-1242 Link Here
1227
	        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1266
	        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1228
	        + " -1.5 -g -preserveAllLocals"
1267
	        + " -1.5 -g -preserveAllLocals"
1229
	        + " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" 
1268
	        + " -cp dummmy_dir" + File.pathSeparator + "dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" 
1230
	        + " -verbose -proceedOnError -referenceInfo" 
1269
	        + " -proceedOnError -referenceInfo" 
1231
	        + " -d \"" + OUTPUT_DIR + "\"",
1270
	        + " -d \"" + OUTPUT_DIR + "\"",
1232
	        "[2 .class files generated]\n",
1271
	        "",
1233
	        "incorrect classpath: dummmy_dir\n" + 
1272
	        "incorrect classpath: dummmy_dir\n",
1234
	        "incorrect classpath: dummy.jar\n" + 
1235
	        "incorrect classpath: dummy.jar\n",
1236
	        true);
1273
	        true);
1237
	}
1274
	}
1275
// we tolerate inexisting jars on the classpath
1276
// TODO (maxime) check and document
1277
public void _test017b(){
1278
	this.runConformTest(
1279
		new String[] {
1280
				"X.java",
1281
				"/** */\n" + 
1282
				"public class X {\n" + 
1283
				"	OK1 ok1;\n" + 
1284
				"}",
1285
				"OK1.java",
1286
				"/** */\n" + 
1287
				"public class OK1 {\n" + 
1288
				"	// empty\n" + 
1289
				"}"
1290
		},
1291
        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1292
        + " -1.5 -g -preserveAllLocals"
1293
        + " -cp dummy.jar" + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" 
1294
        + " -verbose -proceedOnError -referenceInfo" 
1295
        + " -d \"" + OUTPUT_DIR + "\"",
1296
        "[2 .class files generated]\n",
1297
        "incorrect classpath: dummmy.jar\n",
1298
        true);
1299
}
1300
// we tolerate empty classpath entries
1301
// TODO (maxime) check and document
1302
public void _test017c(){
1303
	this.runConformTest(
1304
		new String[] {
1305
				"X.java",
1306
				"/** */\n" + 
1307
				"public class X {\n" + 
1308
				"	OK1 ok1;\n" + 
1309
				"}",
1310
				"OK1.java",
1311
				"/** */\n" + 
1312
				"public class OK1 {\n" + 
1313
				"	// empty\n" + 
1314
				"}"
1315
		},
1316
        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1317
        + " -1.5 -g -preserveAllLocals"
1318
        + " -cp " + File.pathSeparator + File.pathSeparator + "\"" + OUTPUT_DIR + "\"" 
1319
        + " -verbose -proceedOnError -referenceInfo" 
1320
        + " -d \"" + OUTPUT_DIR + "\"",
1321
        "[2 .class files generated]\n",
1322
        "incorrect classpath\n",
1323
        true);
1324
}
1238
// command line - unusual classpath (empty, but using current directory, still OK provided 
1325
// command line - unusual classpath (empty, but using current directory, still OK provided 
1239
//	that we execute from the appropriate directory)
1326
//	that we execute from the appropriate directory); since there is no notion
1327
// of current directory for this tests suite, the test is not executed
1328
// TODO (maxime) enforce working directory
1240
	public void _test018(){
1329
	public void _test018(){
1241
		this.runConformTest(
1330
		this.runConformTest(
1242
			new String[] {
1331
			new String[] {
Lines 1259-1265 Link Here
1259
	        "",
1348
	        "",
1260
	        true);
1349
	        true);
1261
	}
1350
	}
1262
public void _test019(){
1351
public void test019(){
1263
		this.runNegativeTest(
1352
		this.runNegativeTest(
1264
			new String[] {
1353
			new String[] {
1265
				"X.java",
1354
				"X.java",
Lines 1295-1330 Link Here
1295
	        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1384
	        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1296
	        + " -1.5 -g -preserveAllLocals" 
1385
	        + " -1.5 -g -preserveAllLocals" 
1297
	        + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\""
1386
	        + " -cp \"" + OUTPUT_DIR + "[+OK2" + File.pathSeparator + "~Warn" + File.pathSeparator + "-KO]\""
1298
	        + " -verbose -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" 
1387
	        + " -warn:+deprecation,syntheticAccess,uselessTypeCheck,unsafe,finalBound,unusedLocal" 
1299
	        + " -proceedOnError -referenceInfo"
1388
	        + " -proceedOnError -referenceInfo"
1300
	        + " -d \"" + OUTPUT_DIR + "\"", 
1389
	        + " -d \"" + OUTPUT_DIR + "\"", 
1301
	        "[5 .class files generated]\n", 
1390
	        "", 
1302
	        "----------\n" + 
1391
			"----------\n" + 
1303
	        "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
1392
			"1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + 
1304
	        " (at line 5)\n" + 
1393
			" (at line 5)\n" + 
1305
	        "	Warn warn;\n" + 
1394
			"	Warn warn;\n" + 
1306
	        "	^^^^\n" + 
1395
			"	^^^^\n" + 
1307
	        "Discouraged access: Warn\n" + 
1396
			"Discouraged access: The type Warn is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + 
1308
	        "----------\n" + 
1397
			"----------\n" + 
1309
	        "----------\n" + 
1398
			"2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + 
1310
	        "2. WARNING in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
1399
			" (at line 6)\n" + 
1311
	        " (at line 6)\n" + 
1400
			"	KO ko;\n" + 
1312
	        "	KO ko;\n" + 
1401
			"	^^\n" + 
1313
	        "	^^\n" + 
1402
			"Access restriction: The type KO is not accessible due to restriction on classpath entry ---OUTPUT_DIR_PLACEHOLDER---\n" + 
1314
	        "Access restriction: KO\n" + 
1403
			"----------\n" + 
1315
	        "----------\n" + 
1404
			"3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java\n" + 
1316
	        "----------\n" + 
1405
			" (at line 7)\n" + 
1317
	        "3. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
1406
			"	Zork z;\n" + 
1318
	        " (at line 7)\n" + 
1407
			"	^^^^\n" + 
1319
	        "	Zork z;\n" + 
1408
			"Zork cannot be resolved to a type\n" + 
1320
	        "	^^^^\n" + 
1409
			"----------\n" + 
1321
	        "Zork cannot be resolved to a type\n" + 
1410
			"3 problems (1 error, 2 warnings)",
1322
	        "----------\n" + 
1323
	        "3 problems (1 error, 2 warnings)",
1324
	        true);
1411
	        true);
1325
	}
1412
	}
1326
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed
1413
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - skip options -O -Jxxx and -Xxxx, multiple times if needed
1327
	public void _test020(){
1414
	public void test020(){
1328
		this.runConformTest(
1415
		this.runConformTest(
1329
			new String[] {
1416
			new String[] {
1330
					"X.java",
1417
					"X.java",
Lines 1336-1347 Link Here
1336
	        + " -1.5 -g -preserveAllLocals"
1423
	        + " -1.5 -g -preserveAllLocals"
1337
	        + " -verbose -proceedOnError -referenceInfo"
1424
	        + " -verbose -proceedOnError -referenceInfo"
1338
	        + " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu",
1425
	        + " -d \"" + OUTPUT_DIR + "\" -O -Xxxx -O -Jxyz -Xtyu -Jyu",
1339
	        "[1 .class file generated]\n",
1426
			"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
1427
			"[reading    java/lang/Object.class]\n" + 
1428
			"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
1429
			"[writing    X.class - #1]\n" + 
1430
			"[completed  ---OUTPUT_DIR_PLACEHOLDER---/X.java - #1/1]\n" + 
1431
			"[1 unit compiled]\n" + 
1432
			"[1 .class file generated]\n",
1340
	        "",
1433
	        "",
1341
	        true);
1434
	        true);
1342
	}
1435
	}
1343
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files
1436
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -sourcepath finds additional source files
1344
	public void _test021(){
1437
	public void test021(){
1345
		this.runConformTest(
1438
		this.runConformTest(
1346
			new String[] {
1439
			new String[] {
1347
					"src1/X.java",
1440
					"src1/X.java",
Lines 1359-1365 Link Here
1359
	        + " -1.5 -g -preserveAllLocals"
1452
	        + " -1.5 -g -preserveAllLocals"
1360
	        + " -verbose -proceedOnError -referenceInfo"
1453
	        + " -verbose -proceedOnError -referenceInfo"
1361
	        + " -d \"" + OUTPUT_DIR + "\" ",
1454
	        + " -d \"" + OUTPUT_DIR + "\" ",
1362
	        "[2 .class files generated]\n",
1455
			"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + 
1456
			"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1457
			"[reading    java/lang/Object.class]\n" + 
1458
			"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + 
1459
			"[writing    Y.class - #1]\n" + 
1460
			"[completed  ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + 
1461
			"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1462
			"[writing    X.class - #2]\n" + 
1463
			"[completed  ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1464
			"[2 units compiled]\n" + 
1465
			"[2 .class files generated]\n",
1363
	        "",
1466
	        "",
1364
	        true);
1467
	        true);
1365
	}
1468
	}
Lines 1411-1417 Link Here
1411
		        true);
1514
		        true);
1412
		}
1515
		}
1413
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions
1516
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions
1414
		public void _test024(){
1517
		public void test024(){
1415
			this.runNegativeTest(
1518
			this.runNegativeTest(
1416
				new String[] {
1519
				new String[] {
1417
						"X.java",
1520
						"X.java",
Lines 1423-1431 Link Here
1423
		        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1526
		        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1424
				+ " -extdirs \"\"" 
1527
				+ " -extdirs \"\"" 
1425
		        + " -1.5 -g -preserveAllLocals"
1528
		        + " -1.5 -g -preserveAllLocals"
1426
		        + " -verbose -proceedOnError -referenceInfo"
1529
		        + " -proceedOnError -referenceInfo"
1427
		        + " -d \"" + OUTPUT_DIR + "\" ",
1530
		        + " -d \"" + OUTPUT_DIR + "\" ",
1428
		        "[1 .class file generated]\n",
1531
		        "",
1429
		        "----------\n" + 
1532
		        "----------\n" + 
1430
		        "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
1533
		        "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---" + File.separator + "X.java\n" + 
1431
		        " (at line 3)\n" + 
1534
		        " (at line 3)\n" + 
Lines 1437-1443 Link Here
1437
		        true);
1540
		        true);
1438
		}
1541
		}
1439
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath
1542
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath
1440
		public void _test025(){
1543
		public void test025(){
1441
			this.runConformTest(
1544
			this.runConformTest(
1442
				new String[] {
1545
				new String[] {
1443
						"src1/X.java",
1546
						"src1/X.java",
Lines 1456-1467 Link Here
1456
		        + " -1.5 -g -preserveAllLocals"
1559
		        + " -1.5 -g -preserveAllLocals"
1457
		        + " -verbose -proceedOnError -referenceInfo"
1560
		        + " -verbose -proceedOnError -referenceInfo"
1458
		        + " -d \"" + OUTPUT_DIR + "\" ",
1561
		        + " -d \"" + OUTPUT_DIR + "\" ",
1459
		        "[2 .class files generated]\n",
1562
				"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + 
1563
				"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1564
				"[reading    java/lang/Object.class]\n" + 
1565
				"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + 
1566
				"[writing    Y.class - #1]\n" + 
1567
				"[completed  ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + 
1568
				"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1569
				"[reading    sun/net/spi/nameservice/dns/DNSNameService.class]\n" + 
1570
				"[writing    X.class - #2]\n" + 
1571
				"[completed  ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1572
				"[2 units compiled]\n" + 
1573
				"[2 .class files generated]\n",
1460
		        "",
1574
		        "",
1461
		        true);
1575
		        true);
1462
		}
1576
		}
1463
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath
1577
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - -extdirs extends the classpath before -classpath
1464
		public void _test026(){
1578
		public void test026(){
1465
			this.runConformTest(
1579
			this.runConformTest(
1466
				new String[] {
1580
				new String[] {
1467
						"src1/X.java",
1581
						"src1/X.java",
Lines 1485-1491 Link Here
1485
		        + " -1.5 -g -preserveAllLocals"
1599
		        + " -1.5 -g -preserveAllLocals"
1486
		        + " -verbose -proceedOnError -referenceInfo"
1600
		        + " -verbose -proceedOnError -referenceInfo"
1487
		        + " -d \"" + OUTPUT_DIR + "\" ",
1601
		        + " -d \"" + OUTPUT_DIR + "\" ",
1488
		        "[2 .class files generated]\n",
1602
				"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/1]\n" + 
1603
				"[parsing    ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1604
				"[reading    java/lang/Object.class]\n" + 
1605
				"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + 
1606
				"[writing    Y.class - #1]\n" + 
1607
				"[completed  ---OUTPUT_DIR_PLACEHOLDER---/src2/Y.java - #1/2]\n" + 
1608
				"[analyzing  ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1609
				"[writing    X.class - #2]\n" + 
1610
				"[completed  ---OUTPUT_DIR_PLACEHOLDER---/src1/X.java - #2/2]\n" + 
1611
				"[2 units compiled]\n" + 
1612
				"[2 .class files generated]\n",
1489
				"",
1613
				"",
1490
		        true);
1614
		        true);
1491
		}
1615
		}

Return to bug 99620