JDK-8268156 : Add SourceVersion.RELEASE_18
  • Type: CSR
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 18
  • Submitted: 2021-06-03
  • Updated: 2021-06-07
  • Resolved: 2021-06-07
Related Reports
CSR :  
Description
Summary
-------

Add a new enum constant `RELEASE_18` to `javax.lang.model.SourceVersion` for the JDK 18 release and update the `FooVisitor14` visitors to cover release 18 as well.

Problem
-------

The `SourceVersion` enum needs an enum constant for each release being modeled.

Solution
--------

Append the enum constant `RELEASE_18` and update the visitor text and supported source version annotations to cover from `RELEASE_14` to `RELEASE_18`.

Specification
-------------

    diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
    index f4421274e97f..3d01c2023dee 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
    @@ -237,7 +237,15 @@
          *
          * @since 17
          */
    -    RELEASE_17;
    +    RELEASE_17,
    +
    +    /**
    +     * The version recognized by the Java Platform, Standard Edition
    +     * 18.
    +     *
    +     * @since 18
    +     */
    +    RELEASE_18;
     
    
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor14.java
    index 08a2fb51e6a2..e46f9053d008 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor14.java
    @@ -44,7 +44,7 @@
      * @see AbstractAnnotationValueVisitor9
      * @since 14
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public abstract class AbstractAnnotationValueVisitor14<R, P> extends AbstractAnnotationValueVisitor9<R, P> {
     
         /**
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java
    index a0b8484982d6..8bb3c0b6250f 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java
    @@ -49,7 +49,7 @@
      * @see AbstractElementVisitor9
      * @since 16
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public abstract class AbstractElementVisitor14<R, P> extends AbstractElementVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses to call.
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor14.java
    index ac7ac4e07810..d35c86d9db99 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor14.java
    @@ -47,7 +47,7 @@
      * @see AbstractTypeVisitor9
      * @since 14
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public abstract class AbstractTypeVisitor14<R, P> extends AbstractTypeVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses to call.
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor14.java
    index 681c311bd914..4c1269412b3b 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor14.java
    @@ -61,7 +61,7 @@
      * @see ElementKindVisitor9
      * @since 16
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public class ElementKindVisitor14<R, P> extends ElementKindVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java
    index bc7618c45415..c436ea4e044d 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner14.java
    @@ -76,7 +76,7 @@
      * @see ElementScanner9
      * @since 16
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public class ElementScanner14<R, P> extends ElementScanner9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor14.java
    index 347b52250317..0aa8e2f74e86 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor14.java
    @@ -52,7 +52,7 @@
      * @see SimpleAnnotationValueVisitor9
      * @since 14
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public class SimpleAnnotationValueVisitor14<R, P> extends SimpleAnnotationValueVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java
    index b8de0fe676c5..4e59a93581d2 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java
    @@ -57,7 +57,7 @@
      * @see SimpleElementVisitor9
      * @since 16
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public class SimpleElementVisitor14<R, P> extends SimpleElementVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor14.java
    index 25af6688f6fe..0ac41e645b8c 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor14.java
    @@ -56,7 +56,7 @@
      * @see SimpleTypeVisitor9
      * @since 14
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public class SimpleTypeVisitor14<R, P> extends SimpleTypeVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff --git a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor14.java b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor14.java
    index 1adc9749364b..faeef22263e8 100644
    --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor14.java
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor14.java
    @@ -61,7 +61,7 @@
      * @see TypeKindVisitor9
      * @since 14
      */
    -@SupportedSourceVersion(RELEASE_17)
    +@SupportedSourceVersion(RELEASE_18)
     public class TypeKindVisitor14<R, P> extends TypeKindVisitor9<R, P> {
         /**
          * Constructor for concrete subclasses to call; uses {@code null}
Comments
Moving to Approved.
07-06-2021