< prev index next >

src/java.compiler/share/classes/javax/lang/model/SourceVersion.java

Print this page

        

*** 56,68 **** * 1.7: diamond syntax, try-with-resources, etc. * 1.8: lambda expressions and default methods * 9: modules, small cleanups to 1.7 and 1.8 changes * 10: local-variable type inference (var) * 11: local-variable syntax for lambda parameters ! * 12: no changes (switch expressions were in preview) ! * 13: no changes (switch expressions and text blocks in preview) ! * 14: TBD */ /** * The original version. * --- 56,67 ---- * 1.7: diamond syntax, try-with-resources, etc. * 1.8: lambda expressions and default methods * 9: modules, small cleanups to 1.7 and 1.8 changes * 10: local-variable type inference (var) * 11: local-variable syntax for lambda parameters ! * 12: no changes (switch expressions in preview) ! * 13: TBD */ /** * The original version. *
*** 191,220 **** * The version recognized by the Java Platform, Standard Edition * 13. * * @since 13 */ ! RELEASE_13, ! ! /** ! * The version recognized by the Java Platform, Standard Edition ! * 14. ! * ! * @since 14 ! */ ! RELEASE_14; // Note that when adding constants for newer releases, the // behavior of latest() and latestSupported() must be updated too. /** * Returns the latest source version that can be modeled. * * @return the latest source version that can be modeled */ public static SourceVersion latest() { ! return RELEASE_14; } private static final SourceVersion latestSupported = getLatestSupported(); /* --- 190,211 ---- * The version recognized by the Java Platform, Standard Edition * 13. * * @since 13 */ ! RELEASE_13; // Note that when adding constants for newer releases, the // behavior of latest() and latestSupported() must be updated too. /** * Returns the latest source version that can be modeled. * * @return the latest source version that can be modeled */ public static SourceVersion latest() { ! return RELEASE_13; } private static final SourceVersion latestSupported = getLatestSupported(); /*
*** 225,235 **** * need to be updated accordingly. */ private static SourceVersion getLatestSupported() { int intVersion = Runtime.version().feature(); return (intVersion >= 11) ? ! valueOf("RELEASE_" + Math.min(14, intVersion)): RELEASE_10; } /** * Returns the latest source version fully supported by the --- 216,226 ---- * need to be updated accordingly. */ private static SourceVersion getLatestSupported() { int intVersion = Runtime.version().feature(); return (intVersion >= 11) ? ! valueOf("RELEASE_" + Math.min(13, intVersion)): RELEASE_10; } /** * Returns the latest source version fully supported by the
*** 264,275 **** * of an initial character for which {@link * Character#isJavaIdentifierStart(int)} returns {@code true}, * followed only by characters for which {@link * Character#isJavaIdentifierPart(int)} returns {@code true}. * This pattern matches regular identifiers, keywords, restricted ! * keywords, restricted identifiers and the literals {@code "true"}, ! * {@code "false"}, {@code "null"}. * * The method returns {@code false} for all other strings. * * @param name the string to check * @return {@code true} if this string is a --- 255,266 ---- * of an initial character for which {@link * Character#isJavaIdentifierStart(int)} returns {@code true}, * followed only by characters for which {@link * Character#isJavaIdentifierPart(int)} returns {@code true}. * This pattern matches regular identifiers, keywords, restricted ! * keywords, and the literals {@code "true"}, {@code "false"}, ! * {@code "null"}, and {@code "var"}. * * The method returns {@code false} for all other strings. * * @param name the string to check * @return {@code true} if this string is a
*** 302,312 **** * qualified name in the latest source version. Unlike {@link * #isIdentifier isIdentifier}, this method returns {@code false} * for keywords, boolean literals, and the null literal. * * This method returns {@code true} for <i>restricted ! * keywords</i> and <i>restricted identifiers</i> * * @param name the string to check * @return {@code true} if this string is a * syntactically valid name, {@code false} otherwise. * @jls 3.9 Keywords --- 293,303 ---- * qualified name in the latest source version. Unlike {@link * #isIdentifier isIdentifier}, this method returns {@code false} * for keywords, boolean literals, and the null literal. * * This method returns {@code true} for <i>restricted ! * keywords</i> and {@code "var"}. * * @param name the string to check * @return {@code true} if this string is a * syntactically valid name, {@code false} otherwise. * @jls 3.9 Keywords
*** 321,331 **** * qualified name in the given source version. Unlike {@link * #isIdentifier isIdentifier}, this method returns {@code false} * for keywords, boolean literals, and the null literal. * * This method returns {@code true} for <i>restricted ! * keywords</i> and <i>restricted identifiers</i> * * @param name the string to check * @param version the version to use * @return {@code true} if this string is a * syntactically valid name, {@code false} otherwise. --- 312,322 ---- * qualified name in the given source version. Unlike {@link * #isIdentifier isIdentifier}, this method returns {@code false} * for keywords, boolean literals, and the null literal. * * This method returns {@code true} for <i>restricted ! * keywords</i> and {@code "var"}. * * @param name the string to check * @param version the version to use * @return {@code true} if this string is a * syntactically valid name, {@code false} otherwise.
*** 345,355 **** /** * Returns whether or not {@code s} is a keyword, boolean literal, * or null literal in the latest source version. * This method returns {@code false} for <i>restricted ! * keywords</i> and <i>restricted identifiers</i>. * * @param s the string to check * @return {@code true} if {@code s} is a keyword, or boolean * literal, or null literal, {@code false} otherwise. * @jls 3.9 Keywords --- 336,346 ---- /** * Returns whether or not {@code s} is a keyword, boolean literal, * or null literal in the latest source version. * This method returns {@code false} for <i>restricted ! * keywords</i> and {@code "var"}. * * @param s the string to check * @return {@code true} if {@code s} is a keyword, or boolean * literal, or null literal, {@code false} otherwise. * @jls 3.9 Keywords
*** 362,372 **** /** * Returns whether or not {@code s} is a keyword, boolean literal, * or null literal in the given source version. * This method returns {@code false} for <i>restricted ! * keywords</i> and <i>restricted identifiers</i>. * * @param s the string to check * @param version the version to use * @return {@code true} if {@code s} is a keyword, or boolean * literal, or null literal, {@code false} otherwise. --- 353,363 ---- /** * Returns whether or not {@code s} is a keyword, boolean literal, * or null literal in the given source version. * This method returns {@code false} for <i>restricted ! * keywords</i> and {@code "var"}. * * @param s the string to check * @param version the version to use * @return {@code true} if {@code s} is a keyword, or boolean * literal, or null literal, {@code false} otherwise.
< prev index next >