equal
deleted
inserted
replaced
28 import java.util.*; |
28 import java.util.*; |
29 |
29 |
30 import com.sun.tools.javac.code.Flags; |
30 import com.sun.tools.javac.code.Flags; |
31 import com.sun.tools.javac.code.Symbol; |
31 import com.sun.tools.javac.code.Symbol; |
32 import com.sun.tools.javac.util.*; |
32 import com.sun.tools.javac.util.*; |
|
33 |
|
34 import static com.sun.tools.javac.main.OptionName.*; |
33 |
35 |
34 /** The classfile version target. |
36 /** The classfile version target. |
35 * |
37 * |
36 * <p><b>This is NOT part of any supported API. |
38 * <p><b>This is NOT part of any supported API. |
37 * If you write code that depends on this, you do so at your own risk. |
39 * If you write code that depends on this, you do so at your own risk. |
71 |
73 |
72 public static Target instance(Context context) { |
74 public static Target instance(Context context) { |
73 Target instance = context.get(targetKey); |
75 Target instance = context.get(targetKey); |
74 if (instance == null) { |
76 if (instance == null) { |
75 Options options = Options.instance(context); |
77 Options options = Options.instance(context); |
76 String targetString = options.get("-target"); |
78 String targetString = options.get(TARGET); |
77 if (targetString != null) instance = lookup(targetString); |
79 if (targetString != null) instance = lookup(targetString); |
78 if (instance == null) instance = DEFAULT; |
80 if (instance == null) instance = DEFAULT; |
79 context.put(targetKey, instance); |
81 context.put(targetKey, instance); |
80 } |
82 } |
81 return instance; |
83 return instance; |