langtools/src/share/classes/com/sun/tools/javac/main/Main.java
changeset 15724 3063fb01c8a1
parent 14960 ea7606a9683e
child 16799 fbe4d27b8791
equal deleted inserted replaced
15723:58a73dac9ee4 15724:3063fb01c8a1
    47 import com.sun.tools.doclint.DocLint;
    47 import com.sun.tools.doclint.DocLint;
    48 import com.sun.tools.javac.api.BasicJavacTask;
    48 import com.sun.tools.javac.api.BasicJavacTask;
    49 import com.sun.tools.javac.code.Source;
    49 import com.sun.tools.javac.code.Source;
    50 import com.sun.tools.javac.file.CacheFSInfo;
    50 import com.sun.tools.javac.file.CacheFSInfo;
    51 import com.sun.tools.javac.file.JavacFileManager;
    51 import com.sun.tools.javac.file.JavacFileManager;
       
    52 import com.sun.tools.javac.jvm.Profile;
    52 import com.sun.tools.javac.jvm.Target;
    53 import com.sun.tools.javac.jvm.Target;
    53 import com.sun.tools.javac.processing.AnnotationProcessingError;
    54 import com.sun.tools.javac.processing.AnnotationProcessingError;
    54 import com.sun.tools.javac.processing.JavacProcessingEnvironment;
    55 import com.sun.tools.javac.processing.JavacProcessingEnvironment;
    55 import com.sun.tools.javac.util.*;
    56 import com.sun.tools.javac.util.*;
    56 import com.sun.tools.javac.util.Log.PrefixKind;
    57 import com.sun.tools.javac.util.Log.PrefixKind;
    74      */
    75      */
    75     PrintWriter out;
    76     PrintWriter out;
    76 
    77 
    77     /** The log to use for diagnostic output.
    78     /** The log to use for diagnostic output.
    78      */
    79      */
    79     Log log;
    80     public Log log;
    80 
    81 
    81     /**
    82     /**
    82      * If true, certain errors will cause an exception, such as command line
    83      * If true, certain errors will cause an exception, such as command line
    83      * arg errors, or exceptions in user provided code.
    84      * arg errors, or exceptions in user provided code.
    84      */
    85      */
   163      */
   164      */
   164     public Main(String name, PrintWriter out) {
   165     public Main(String name, PrintWriter out) {
   165         this.ownName = name;
   166         this.ownName = name;
   166         this.out = out;
   167         this.out = out;
   167     }
   168     }
       
   169 
   168     /** A table of all options that's passed to the JavaCompiler constructor.  */
   170     /** A table of all options that's passed to the JavaCompiler constructor.  */
   169     private Options options = null;
   171     private Options options = null;
   170 
   172 
   171     /** The list of source files to process
   173     /** The list of source files to process
   172      */
   174      */
   302             } else {
   304             } else {
   303                 if (targetString == null && !source.allowGenerics()) {
   305                 if (targetString == null && !source.allowGenerics()) {
   304                     target = Target.JDK1_4;
   306                     target = Target.JDK1_4;
   305                     options.put("-target", target.name);
   307                     options.put("-target", target.name);
   306                 }
   308                 }
       
   309             }
       
   310         }
       
   311 
       
   312         String profileString = options.get(PROFILE);
       
   313         if (profileString != null) {
       
   314             Profile profile = Profile.lookup(profileString);
       
   315             if (!profile.isValid(target)) {
       
   316                 warning("warn.profile.target.conflict", profileString, target.name);
       
   317                 return null;
   307             }
   318             }
   308         }
   319         }
   309 
   320 
   310         // handle this here so it works even if no other options given
   321         // handle this here so it works even if no other options given
   311         String showClass = options.get("showClass");
   322         String showClass = options.get("showClass");