--- old/src/share/classes/com/sun/tools/javac/code/Source.java 2013-12-14 12:19:59.000000000 -0800 +++ new/src/share/classes/com/sun/tools/javac/code/Source.java 2013-12-14 12:19:59.000000000 -0800 @@ -67,8 +67,11 @@ /** 1.7 introduced try-with-resources, multi-catch, string switch, etc. */ JDK1_7("1.7"), - /** 1.8 covers the to be determined language features that will be added in JDK 8. */ - JDK1_8("1.8"); + /** 1.8 lambda expressions and default methods. */ + JDK1_8("1.8"), + + /** 1.9 covers the to be determined language features that will be added in JDK 9. */ + JDK1_9("1.9"); private static final Context.Key sourceKey = new Context.Key(); @@ -87,7 +90,7 @@ public final String name; - private static final Map tab = new HashMap(); + private static final Map tab = new HashMap<>(); static { for (Source s : values()) { tab.put(s.name, s); @@ -96,19 +99,21 @@ tab.put("6", JDK1_6); // Make 6 an alias for 1.6 tab.put("7", JDK1_7); // Make 7 an alias for 1.7 tab.put("8", JDK1_8); // Make 8 an alias for 1.8 + tab.put("9", JDK1_9); // Make 9 an alias for 1.9 } private Source(String name) { this.name = name; } - public static final Source DEFAULT = JDK1_8; + public static final Source DEFAULT = JDK1_9; public static Source lookup(String name) { return tab.get(name); } public Target requiredTarget() { + if (this.compareTo(JDK1_9) >= 0) return Target.JDK1_9; if (this.compareTo(JDK1_8) >= 0) return Target.JDK1_8; if (this.compareTo(JDK1_7) >= 0) return Target.JDK1_7; if (this.compareTo(JDK1_6) >= 0) return Target.JDK1_6; @@ -243,6 +248,8 @@ return RELEASE_7; case JDK1_8: return RELEASE_8; + case JDK1_9: + return RELEASE_8; // Adjust once RELEASE_9 exists default: return null; }