src/share/classes/com/sun/tools/javac/main/JavaCompiler.java

changeset 215
9d541fd2916b
parent 198
b4b1f7732289
child 229
03bcd66bd8e7
equal deleted inserted replaced
213:49281ea88125 215:9d541fd2916b
369 options.get("-g:lines") != null; 369 options.get("-g:lines") != null;
370 genEndPos = options.get("-Xjcov") != null || 370 genEndPos = options.get("-Xjcov") != null ||
371 context.get(DiagnosticListener.class) != null; 371 context.get(DiagnosticListener.class) != null;
372 devVerbose = options.get("dev") != null; 372 devVerbose = options.get("dev") != null;
373 processPcks = options.get("process.packages") != null; 373 processPcks = options.get("process.packages") != null;
374 werror = options.get("-Werror") != null;
374 375
375 verboseCompilePolicy = options.get("verboseCompilePolicy") != null; 376 verboseCompilePolicy = options.get("verboseCompilePolicy") != null;
376 377
377 if (attrParseOnly) 378 if (attrParseOnly)
378 compilePolicy = CompilePolicy.ATTR_ONLY; 379 compilePolicy = CompilePolicy.ATTR_ONLY;
431 protected boolean devVerbose; 432 protected boolean devVerbose;
432 433
433 /** Switch: should we (annotation) process packages as well 434 /** Switch: should we (annotation) process packages as well
434 */ 435 */
435 protected boolean processPcks; 436 protected boolean processPcks;
437
438 /** Switch: treat warnings as errors
439 */
440 protected boolean werror;
436 441
437 /** Switch: is annotation processing requested explitly via 442 /** Switch: is annotation processing requested explitly via
438 * CompilationTask.setProcessors? 443 * CompilationTask.setProcessors?
439 */ 444 */
440 protected boolean explicitAnnotationProcessingRequested = false; 445 protected boolean explicitAnnotationProcessingRequested = false;
488 /** The number of errors reported so far. 493 /** The number of errors reported so far.
489 */ 494 */
490 public int errorCount() { 495 public int errorCount() {
491 if (delegateCompiler != null && delegateCompiler != this) 496 if (delegateCompiler != null && delegateCompiler != this)
492 return delegateCompiler.errorCount(); 497 return delegateCompiler.errorCount();
493 else 498 else {
499 if (werror && log.nerrors == 0 && log.nwarnings > 0) {
500 log.error("warnings.and.werror");
501 }
502 }
494 return log.nerrors; 503 return log.nerrors;
495 } 504 }
496 505
497 protected final <T> Queue<T> stopIfError(Queue<T> queue) { 506 protected final <T> Queue<T> stopIfError(Queue<T> queue) {
498 if (errorCount() == 0) 507 if (errorCount() == 0)

mercurial