< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java

Print this page
rev 48342 : imported patch JDK-8173382-release-version
rev 48343 : imported patch JDK-8173382-classfile-version


  50 
  51     /** JDK 5, codename Tiger. */
  52     JDK1_5("1.5", 49, 0),
  53 
  54     /** JDK 6. */
  55     JDK1_6("1.6", 50, 0),
  56 
  57     /** JDK 7. */
  58     JDK1_7("1.7", 51, 0),
  59 
  60     /** JDK 8. */
  61     JDK1_8("1.8", 52, 0),
  62 
  63     /** JDK 9. */
  64     JDK1_9("1.9", 53, 0),
  65 
  66     /** JDK 10. */
  67     JDK1_10("1.10", 54, 0),
  68 
  69     /** JDK 11. */
  70     JDK1_11("11", 54, 0); // Initially an alias for JDK_10
  71 
  72     private static final Context.Key<Target> targetKey = new Context.Key<>();
  73 
  74     public static Target instance(Context context) {
  75         Target instance = context.get(targetKey);
  76         if (instance == null) {
  77             Options options = Options.instance(context);
  78             String targetString = options.get(TARGET);
  79             if (targetString != null) instance = lookup(targetString);
  80             if (instance == null) instance = DEFAULT;
  81             context.put(targetKey, instance);
  82         }
  83         return instance;
  84     }
  85 
  86     public static final Target MIN = Target.JDK1_6;
  87 
  88     private static final Target MAX = values()[values().length - 1];
  89 
  90     private static final Map<String,Target> tab = new HashMap<>();




  50 
  51     /** JDK 5, codename Tiger. */
  52     JDK1_5("1.5", 49, 0),
  53 
  54     /** JDK 6. */
  55     JDK1_6("1.6", 50, 0),
  56 
  57     /** JDK 7. */
  58     JDK1_7("1.7", 51, 0),
  59 
  60     /** JDK 8. */
  61     JDK1_8("1.8", 52, 0),
  62 
  63     /** JDK 9. */
  64     JDK1_9("1.9", 53, 0),
  65 
  66     /** JDK 10. */
  67     JDK1_10("1.10", 54, 0),
  68 
  69     /** JDK 11. */
  70     JDK1_11("11", 55, 0);
  71 
  72     private static final Context.Key<Target> targetKey = new Context.Key<>();
  73 
  74     public static Target instance(Context context) {
  75         Target instance = context.get(targetKey);
  76         if (instance == null) {
  77             Options options = Options.instance(context);
  78             String targetString = options.get(TARGET);
  79             if (targetString != null) instance = lookup(targetString);
  80             if (instance == null) instance = DEFAULT;
  81             context.put(targetKey, instance);
  82         }
  83         return instance;
  84     }
  85 
  86     public static final Target MIN = Target.JDK1_6;
  87 
  88     private static final Target MAX = values()[values().length - 1];
  89 
  90     private static final Map<String,Target> tab = new HashMap<>();


< prev index next >