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

changeset 897
9029f694e5df
parent 893
8f0dcb9499db
child 902
2a5c919f20b8
     1.1 --- a/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Feb 28 11:50:56 2011 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Mon Feb 28 12:19:18 2011 -0800
     1.3 @@ -299,6 +299,13 @@
     1.4      protected JavaCompiler delegateCompiler;
     1.5  
     1.6      /**
     1.7 +     * Command line options.
     1.8 +     */
     1.9 +    protected Options options;
    1.10 +
    1.11 +    protected Context context;
    1.12 +
    1.13 +    /**
    1.14       * Flag set if any annotation processing occurred.
    1.15       **/
    1.16      protected boolean annotationProcessingOccurred;
    1.17 @@ -308,8 +315,6 @@
    1.18       **/
    1.19      protected boolean implicitSourceFilesRead;
    1.20  
    1.21 -    protected Context context;
    1.22 -
    1.23      /** Construct a new compiler using a shared context.
    1.24       */
    1.25      public JavaCompiler(Context context) {
    1.26 @@ -354,7 +359,7 @@
    1.27  
    1.28          reader.sourceCompleter = this;
    1.29  
    1.30 -        Options options = Options.instance(context);
    1.31 +        options = Options.instance(context);
    1.32  
    1.33          verbose       = options.isSet(VERBOSE);
    1.34          sourceOutput  = options.isSet(PRINTSOURCE); // used to be -s
    1.35 @@ -792,6 +797,11 @@
    1.36              throw new AssertionError("attempt to reuse JavaCompiler");
    1.37          hasBeenUsed = true;
    1.38  
    1.39 +        // forcibly set the equivalent of -Xlint:-options, so that no further
    1.40 +        // warnings about command line options are generated from this point on
    1.41 +        options.put(XLINT_CUSTOM + "-" + LintCategory.OPTIONS.option, "true");
    1.42 +        options.remove(XLINT_CUSTOM + LintCategory.OPTIONS.option);
    1.43 +
    1.44          start_msec = now();
    1.45  
    1.46          try {
    1.47 @@ -963,7 +973,6 @@
    1.48      public void initProcessAnnotations(Iterable<? extends Processor> processors) {
    1.49          // Process annotations if processing is not disabled and there
    1.50          // is at least one Processor available.
    1.51 -        Options options = Options.instance(context);
    1.52          if (options.isSet(PROC, "none")) {
    1.53              processAnnotations = false;
    1.54          } else if (procEnvImpl == null) {
    1.55 @@ -1022,7 +1031,6 @@
    1.56              // If there are no annotation processors present, and
    1.57              // annotation processing is to occur with compilation,
    1.58              // emit a warning.
    1.59 -            Options options = Options.instance(context);
    1.60              if (options.isSet(PROC, "only")) {
    1.61                  log.warning("proc.proc-only.requested.no.procs");
    1.62                  todo.clear();
    1.63 @@ -1108,7 +1116,6 @@
    1.64      }
    1.65  
    1.66      boolean explicitAnnotationProcessingRequested() {
    1.67 -        Options options = Options.instance(context);
    1.68          return
    1.69              explicitAnnotationProcessingRequested ||
    1.70              options.isSet(PROCESSOR) ||

mercurial