langtools/src/share/classes/javax/lang/model/SourceVersion.java
changeset 22169 4be6dc44489b
parent 22163 3651128c74eb
--- a/langtools/src/share/classes/javax/lang/model/SourceVersion.java	Sun Dec 22 21:57:01 2013 -0800
+++ b/langtools/src/share/classes/javax/lang/model/SourceVersion.java	Tue Jan 07 11:43:56 2014 -0800
@@ -55,6 +55,7 @@
      * 1.6: no changes
      * 1.7: diamond syntax, try-with-resources, etc.
      * 1.8: lambda expressions and default methods
+     * 1.9: To be determined
      */
 
     /**
@@ -138,7 +139,15 @@
      * Additions in this release include lambda expressions and default methods.
      * @since 1.8
      */
-    RELEASE_8;
+    RELEASE_8,
+
+    /**
+     * The version recognized by the Java Platform, Standard Edition
+     * 9.
+     *
+     * @since 1.9
+     */
+     RELEASE_9;
 
     // Note that when adding constants for newer releases, the
     // behavior of latest() and latestSupported() must be updated too.
@@ -149,7 +158,7 @@
      * @return the latest source version that can be modeled
      */
     public static SourceVersion latest() {
-        return RELEASE_8;
+        return RELEASE_9;
     }
 
     private static final SourceVersion latestSupported = getLatestSupported();
@@ -159,6 +168,8 @@
             String specVersion = System.getProperty("java.specification.version");
 
             switch (specVersion) {
+                case "1.9":
+                    return RELEASE_9;
                 case "1.8":
                     return RELEASE_8;
                 case "1.7":
@@ -271,7 +282,6 @@
      * @return {@code true} if {@code s} is a keyword or literal, {@code false} otherwise.
      */
     public static boolean isKeyword(CharSequence s) {
-        String keywordOrLiteral = s.toString();
-        return keywords.contains(keywordOrLiteral);
+        return keywords.contains(s.toString());
     }
 }