src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
changeset 53023 6879069d9d94
parent 51198 979e4708da65
child 54271 44edf64cb206
equal deleted inserted replaced
53022:ece620f32d2d 53023:6879069d9d94
    57      * 1.8: lambda expressions and default methods
    57      * 1.8: lambda expressions and default methods
    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: TBD
    61      *  12: TBD
       
    62      *  13: TBD
    62      */
    63      */
    63 
    64 
    64     /**
    65     /**
    65      * The original version.
    66      * The original version.
    66      *
    67      *
   181      * The version recognized by the Java Platform, Standard Edition
   182      * The version recognized by the Java Platform, Standard Edition
   182      * 12.
   183      * 12.
   183      *
   184      *
   184      * @since 12
   185      * @since 12
   185      */
   186      */
   186      RELEASE_12;
   187      RELEASE_12,
       
   188 
       
   189     /**
       
   190      * The version recognized by the Java Platform, Standard Edition
       
   191      * 13.
       
   192      *
       
   193      * @since 13
       
   194      */
       
   195      RELEASE_13;
   187 
   196 
   188     // Note that when adding constants for newer releases, the
   197     // Note that when adding constants for newer releases, the
   189     // behavior of latest() and latestSupported() must be updated too.
   198     // behavior of latest() and latestSupported() must be updated too.
   190 
   199 
   191     /**
   200     /**
   192      * Returns the latest source version that can be modeled.
   201      * Returns the latest source version that can be modeled.
   193      *
   202      *
   194      * @return the latest source version that can be modeled
   203      * @return the latest source version that can be modeled
   195      */
   204      */
   196     public static SourceVersion latest() {
   205     public static SourceVersion latest() {
   197         return RELEASE_12;
   206         return RELEASE_13;
   198     }
   207     }
   199 
   208 
   200     private static final SourceVersion latestSupported = getLatestSupported();
   209     private static final SourceVersion latestSupported = getLatestSupported();
   201 
   210 
   202     private static SourceVersion getLatestSupported() {
   211     private static SourceVersion getLatestSupported() {
   203         try {
   212         try {
   204             String specVersion = System.getProperty("java.specification.version");
   213             String specVersion = System.getProperty("java.specification.version");
   205 
   214 
   206             switch (specVersion) {
   215             switch (specVersion) {
       
   216                 case "13":
       
   217                     return RELEASE_13;
   207                 case "12":
   218                 case "12":
   208                     return RELEASE_12;
   219                     return RELEASE_12;
   209                 case "11":
   220                 case "11":
   210                     return RELEASE_11;
   221                     return RELEASE_11;
   211                 case "10":
   222                 case "10":