langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java
changeset 10180 b293c1f36ac4
parent 7681 1f0819a3341f
child 11314 b612aaca08d0
equal deleted inserted replaced
10175:9adcace810dd 10180:b293c1f36ac4
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    64 
    64 
    65     /** JDK 6. */
    65     /** JDK 6. */
    66     JDK1_6("1.6", 50, 0),
    66     JDK1_6("1.6", 50, 0),
    67 
    67 
    68     /** JDK 7. */
    68     /** JDK 7. */
    69     JDK1_7("1.7", 51, 0);
    69     JDK1_7("1.7", 51, 0),
       
    70 
       
    71     /** JDK 8. */ // For now, a clone of 7
       
    72     JDK1_8("1.8", 51, 0);
    70 
    73 
    71     private static final Context.Key<Target> targetKey =
    74     private static final Context.Key<Target> targetKey =
    72         new Context.Key<Target>();
    75         new Context.Key<Target>();
    73 
    76 
    74     public static Target instance(Context context) {
    77     public static Target instance(Context context) {
    97             tab.put(t.name, t);
   100             tab.put(t.name, t);
    98         }
   101         }
    99         tab.put("5", JDK1_5);
   102         tab.put("5", JDK1_5);
   100         tab.put("6", JDK1_6);
   103         tab.put("6", JDK1_6);
   101         tab.put("7", JDK1_7);
   104         tab.put("7", JDK1_7);
       
   105         tab.put("8", JDK1_8);
   102     }
   106     }
   103 
   107 
   104     public final String name;
   108     public final String name;
   105     public final int majorVersion;
   109     public final int majorVersion;
   106     public final int minorVersion;
   110     public final int minorVersion;
   108         this.name = name;
   112         this.name = name;
   109         this.majorVersion = majorVersion;
   113         this.majorVersion = majorVersion;
   110         this.minorVersion = minorVersion;
   114         this.minorVersion = minorVersion;
   111     }
   115     }
   112 
   116 
   113     public static final Target DEFAULT = JDK1_7;
   117     public static final Target DEFAULT = JDK1_8;
   114 
   118 
   115     public static Target lookup(String name) {
   119     public static Target lookup(String name) {
   116         return tab.get(name);
   120         return tab.get(name);
   117     }
   121     }
   118 
   122