< prev index next >

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

Print this page




  53 
  54     /** JDK 6. */
  55     JDK1_6("6", 50, 0),
  56 
  57     /** JDK 7. */
  58     JDK1_7("7", 51, 0),
  59 
  60     /** JDK 8. */
  61     JDK1_8("8", 52, 0),
  62 
  63     /** JDK 9. */
  64     JDK1_9("9", 53, 0),
  65 
  66     /** JDK 10. */
  67     JDK1_10("10", 54, 0),
  68 
  69     /** JDK 11. */
  70     JDK1_11("11", 55, 0),
  71 
  72     /** JDK 12. */
  73     JDK1_12("12", 56, 0);



  74 
  75     private static final Context.Key<Target> targetKey = new Context.Key<>();
  76 
  77     public static Target instance(Context context) {
  78         Target instance = context.get(targetKey);
  79         if (instance == null) {
  80             Options options = Options.instance(context);
  81             String targetString = options.get(TARGET);
  82             if (targetString != null) instance = lookup(targetString);
  83             if (instance == null) instance = DEFAULT;
  84             context.put(targetKey, instance);
  85         }
  86         return instance;
  87     }
  88 
  89     public static final Target MIN = Target.JDK1_7;
  90 
  91     private static final Target MAX = values()[values().length - 1];
  92 
  93     private static final Map<String,Target> tab = new HashMap<>();




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


< prev index next >