src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
changeset 55382 30b1b7b4dd86
parent 55318 040e1c6dab96
child 58679 9c3209ff7550
child 59068 dc45ed0ab083
equal deleted inserted replaced
55381:7c9151c7dc40 55382:30b1b7b4dd86
    58      *   9: modules, small cleanups to 1.7 and 1.8 changes
    58      *   9: modules, small cleanups to 1.7 and 1.8 changes
    59      *  10: local-variable type inference (var)
    59      *  10: local-variable type inference (var)
    60      *  11: local-variable syntax for lambda parameters
    60      *  11: local-variable syntax for lambda parameters
    61      *  12: no changes (switch expressions were in preview)
    61      *  12: no changes (switch expressions were in preview)
    62      *  13: no changes (switch expressions and text blocks in preview)
    62      *  13: no changes (switch expressions and text blocks in preview)
       
    63      *  14: TBD
    63      */
    64      */
    64 
    65 
    65     /**
    66     /**
    66      * The original version.
    67      * The original version.
    67      *
    68      *
   190      * The version recognized by the Java Platform, Standard Edition
   191      * The version recognized by the Java Platform, Standard Edition
   191      * 13.
   192      * 13.
   192      *
   193      *
   193      * @since 13
   194      * @since 13
   194      */
   195      */
   195      RELEASE_13;
   196      RELEASE_13,
       
   197 
       
   198     /**
       
   199      * The version recognized by the Java Platform, Standard Edition
       
   200      * 14.
       
   201      *
       
   202      * @since 14
       
   203      */
       
   204      RELEASE_14;
   196 
   205 
   197     // Note that when adding constants for newer releases, the
   206     // Note that when adding constants for newer releases, the
   198     // behavior of latest() and latestSupported() must be updated too.
   207     // behavior of latest() and latestSupported() must be updated too.
   199 
   208 
   200     /**
   209     /**
   201      * Returns the latest source version that can be modeled.
   210      * Returns the latest source version that can be modeled.
   202      *
   211      *
   203      * @return the latest source version that can be modeled
   212      * @return the latest source version that can be modeled
   204      */
   213      */
   205     public static SourceVersion latest() {
   214     public static SourceVersion latest() {
   206         return RELEASE_13;
   215         return RELEASE_14;
   207     }
   216     }
   208 
   217 
   209     private static final SourceVersion latestSupported = getLatestSupported();
   218     private static final SourceVersion latestSupported = getLatestSupported();
   210 
   219 
   211     /*
   220     /*
   216      * need to be updated accordingly.
   225      * need to be updated accordingly.
   217      */
   226      */
   218     private static SourceVersion getLatestSupported() {
   227     private static SourceVersion getLatestSupported() {
   219         int intVersion = Runtime.version().feature();
   228         int intVersion = Runtime.version().feature();
   220         return (intVersion >= 11) ?
   229         return (intVersion >= 11) ?
   221             valueOf("RELEASE_" + Math.min(13, intVersion)):
   230             valueOf("RELEASE_" + Math.min(14, intVersion)):
   222             RELEASE_10;
   231             RELEASE_10;
   223     }
   232     }
   224 
   233 
   225     /**
   234     /**
   226      * Returns the latest source version fully supported by the
   235      * Returns the latest source version fully supported by the