JDK-8193201 : Update javax.lang.model.util visitors for 10
  • Type: CSR
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 10
  • Submitted: 2017-12-07
  • Updated: 2018-04-26
  • Resolved: 2017-12-08
Related Reports
CSR :  
Relates :  
Description
Summary
-------
Update the JDK 9-era visitors in `javax.lang.model.util` to indicate they cover JDK 10 as well.

Problem
-------

The  `javax.lang.model.util` package traditionally introduces a new set of visitors supporting the new language features in each new release. Since there are no language features in JDK 10 which require language model updates, a new set of visitors is not necessary at this time.

Solution
--------
Update the text of the JDK 9 visitors to indicate they support JDK 9 and JDK 10 and bump the SupportedSourceVersion annotation from RELEASE_9 to RELEASE_10.

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

    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -32,7 +32,7 @@
     /**
      * A skeletal visitor for annotation values with default behavior
      * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9}
    - * source version.
    + * and {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
      *
      * <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
      * implemented by this class may have methods added to it in the
    @@ -59,7 +59,7 @@
      * @see AbstractAnnotationValueVisitor8
      * @since 9
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public abstract class AbstractAnnotationValueVisitor9<R, P> extends AbstractAnnotationValueVisitor8<R, P> {
    
         /**
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -34,7 +34,7 @@
     /**
      * A skeletal visitor of program elements with default behavior
      * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9}
    - * source version.
    + * and {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
      *
      * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
      * implemented by this class may have methods added to it in the
    @@ -65,7 +65,7 @@
      * @since 9
      * @spec JPMS
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public abstract class AbstractElementVisitor9<R, P> extends AbstractElementVisitor8<R, P> {
         /**
          * Constructor for concrete subclasses to call.
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -27,13 +27,13 @@
    
     import javax.annotation.processing.SupportedSourceVersion;
     import javax.lang.model.type.*;
    -
    +import javax.lang.model.SourceVersion;
     import static javax.lang.model.SourceVersion.*;
    
     /**
      * A skeletal visitor of types with default behavior appropriate for
    - * the {@link javax.lang.model.SourceVersion#RELEASE_9 RELEASE_9}
    - * source version.
    + * the {@link SourceVersion#RELEASE_9 RELEASE_9}
    + * and {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
      *
      * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
      * by this class may have methods added to it in the future to
    @@ -63,7 +63,7 @@
      * @see AbstractTypeVisitor8
      * @since 9
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public abstract class AbstractTypeVisitor9<R, P> extends AbstractTypeVisitor8<R, P> {
         /**
          * Constructor for concrete subclasses to call.
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -33,7 +33,8 @@
     /**
      * A visitor of program elements based on their {@linkplain
      * ElementKind kind} with default behavior appropriate for the {@link
    - * SourceVersion#RELEASE_9 RELEASE_9} source version.  For {@linkplain
    + * SourceVersion#RELEASE_9 RELEASE_9} and {@link
    + * SourceVersion#RELEASE_10 RELEASE_10} source versions. For {@linkplain
      * Element elements} <code><i>Xyz</i></code> that may have more than one
      * kind, the <code>visit<i>Xyz</i></code> methods in this class delegate
      * to the <code>visit<i>Xyz</i>As<i>Kind</i></code> method corresponding to the
    @@ -77,7 +78,7 @@
      * @since 9
      * @spec JPMS
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public class ElementKindVisitor9<R, P> extends ElementKindVisitor8<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -34,7 +34,8 @@
     /**
      * A scanning visitor of program elements with default behavior
      * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9}
    - * source version.  The <code>visit<i>Xyz</i></code> methods in this
    + * and {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
    + * The <code>visit<i>Xyz</i></code> methods in this
      * class scan their component elements by calling {@code scan} on
      * their {@linkplain Element#getEnclosedElements enclosed elements},
      * {@linkplain ExecutableElement#getParameters parameters}, etc., as
    @@ -90,7 +91,7 @@
      * @since 9
      * @spec JPMS
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public class ElementScanner9<R, P> extends ElementScanner8<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -32,7 +32,8 @@
     /**
      * A simple visitor for annotation values with default behavior
      * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9}
    - * source version.  Visit methods call {@link #defaultAction
    + * and {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
    + * Visit methods call {@link #defaultAction
      * defaultAction} passing their arguments to {@code defaultAction}'s
      * corresponding parameters.
      *
    @@ -66,7 +67,7 @@
      * @see SimpleAnnotationValueVisitor8
      * @since 9
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public class SimpleAnnotationValueVisitor9<R, P> extends SimpleAnnotationValueVisitor8<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -33,7 +33,7 @@
     /**
      * A simple visitor of program elements with default behavior
      * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9}
    - * source version.
    + * and {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
      *
      * Visit methods corresponding to {@code RELEASE_9} and earlier
      * language constructs call {@link #defaultAction defaultAction},
    @@ -73,7 +73,7 @@
      * @since 9
      * @spec JPMS
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public class SimpleElementVisitor9<R, P> extends SimpleElementVisitor8<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/SimpleTypeVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -32,7 +32,8 @@
    
     /**
      * A simple visitor of types with default behavior appropriate for the
    - * {@link SourceVersion#RELEASE_9 RELEASE_9} source version.
    + * {@link SourceVersion#RELEASE_9 RELEASE_9} and
    + * {@link SourceVersion#RELEASE_10 RELEASE_10} source versions.
      *
      * Visit methods corresponding to {@code RELEASE_9} and earlier
      * language constructs call {@link #defaultAction defaultAction},
    @@ -71,7 +72,7 @@
      * @see SimpleTypeVisitor7
      * @since 9
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public class SimpleTypeVisitor9<R, P> extends SimpleTypeVisitor8<R, P> {
         /**
          * Constructor for concrete subclasses; uses {@code null} for the
    diff -r 56d3576aadd5 src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java
    --- a/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java Mon Dec 04 19:12:57 2017 +0100
    +++ b/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java Thu Dec 07 09:28:13 2017 -0800
    @@ -33,7 +33,8 @@
     /**
      * A visitor of types based on their {@linkplain TypeKind kind} with
      * default behavior appropriate for the {@link SourceVersion#RELEASE_9
    - * RELEASE_9} source version.  For {@linkplain
    + * RELEASE_9} and {@link SourceVersion#RELEASE_10 RELEASE_10} source
    + * versions. For {@linkplain
      * TypeMirror types} <code><i>Xyz</i></code> that may have more than one
      * kind, the <code>visit<i>Xyz</i></code> methods in this class delegate
      * to the <code>visit<i>Xyz</i>As<i>Kind</i></code> method corresponding to the
    @@ -74,7 +75,7 @@
      * @see TypeKindVisitor8
      * @since 9
      */
    -@SupportedSourceVersion(RELEASE_9)
    +@SupportedSourceVersion(RELEASE_10)
     public class TypeKindVisitor9<R, P> extends TypeKindVisitor8<R, P> {
         /**
  * Constructor for concrete subclasses to call; uses {@code null}


Comments
Moving to approved.
08-12-2017