JDK 9 RFR of JDK-8176266: Mae visitUnknown specification more explicit

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JDK 9 RFR of JDK-8176266: Mae visitUnknown specification more explicit

joe darcy

Hello,

The various visitUnknown methods in the javax.lang.model API do not explicitly state they pass down their arguments to the new exception.

This detail should be made explicit.

Please review the patch below.

Thanks,

-Joe


diff -r 099bb085017a src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
--- a/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java    Mon Mar 06 08:57:41 2017 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java    Tue Mar 07 01:27:26 2017 -0800
@@ -251,7 +251,7 @@
          * @param p  a visitor-specified parameter
          * @return a visitor-specified result
          * @throws UnknownDirectiveException a visitor implementation may optionally throw this exception
-         * @implSpec This implementation throws {@code UnknownDirectiveException}.
+         * @implSpec This implementation throws {@code new UnknownDirectiveException(d, p)}.
          */
         default R visitUnknown(Directive d, P p) {
             throw new UnknownDirectiveException(d, p);
diff -r 099bb085017a src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java    Mon Mar 06 08:57:41 2017 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java    Tue Mar 07 01:27:26 2017 -0800
@@ -106,7 +106,7 @@
      *
      * @implSpec The default implementation of this method in {@code
      * AbstractAnnotationValueVisitor6} will always throw {@code
-     * UnknownAnnotationValueException}.  This behavior is not
+     * new UnknownAnnotationValueException(av, p)}.  This behavior is not
      * required of a subclass.
      *
      * @param av {@inheritDoc}
diff -r 099bb085017a src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java    Mon Mar 06 08:57:41 2017 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java    Tue Mar 07 01:27:26 2017 -0800
@@ -111,7 +111,7 @@
      *
      * @implSpec The default implementation of this method in
      * {@code AbstractElementVisitor6} will always throw
-     * {@code UnknownElementException}.
+     * {@code new UnknownElementException(e, p)}.
      * This behavior is not required of a subclass.
      *
      * @param e {@inheritDoc}
diff -r 099bb085017a src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
--- a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java    Mon Mar 06 08:57:41 2017 -0800
+++ b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java    Tue Mar 07 01:27:26 2017 -0800
@@ -142,7 +142,7 @@
      *
      * @implSpec The default implementation of this method in {@code
      * AbstractTypeVisitor6} will always throw {@code
-     * UnknownTypeException}.  This behavior is not required of a
+     * new UnknownTypeException(t, p)}.  This behavior is not required of a
      * subclass.
      *
      * @param t  {@inheritDoc}

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JDK 9 RFR of JDK-8176266: Mae visitUnknown specification more explicit

Jan Lahoda
Seems OK to me.

Jan

On 7.3.2017 10:27, joe darcy wrote:

> Hello,
>
> The various visitUnknown methods in the javax.lang.model API do not
> explicitly state they pass down their arguments to the new exception.
>
> This detail should be made explicit.
>
> Please review the patch below.
>
> Thanks,
>
> -Joe
>
>
> diff -r 099bb085017a
> src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
> ---
> a/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
> Mon Mar 06 08:57:41 2017 -0800
> +++
> b/src/java.compiler/share/classes/javax/lang/model/element/ModuleElement.java
> Tue Mar 07 01:27:26 2017 -0800
> @@ -251,7 +251,7 @@
>            * @param p  a visitor-specified parameter
>            * @return a visitor-specified result
>            * @throws UnknownDirectiveException a visitor implementation
> may optionally throw this exception
> -         * @implSpec This implementation throws {@code
> UnknownDirectiveException}.
> +         * @implSpec This implementation throws {@code new
> UnknownDirectiveException(d, p)}.
>            */
>           default R visitUnknown(Directive d, P p) {
>               throw new UnknownDirectiveException(d, p);
> diff -r 099bb085017a
> src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
> ---
> a/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
> Mon Mar 06 08:57:41 2017 -0800
> +++
> b/src/java.compiler/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java
> Tue Mar 07 01:27:26 2017 -0800
> @@ -106,7 +106,7 @@
>        *
>        * @implSpec The default implementation of this method in {@code
>        * AbstractAnnotationValueVisitor6} will always throw {@code
> -     * UnknownAnnotationValueException}.  This behavior is not
> +     * new UnknownAnnotationValueException(av, p)}.  This behavior is not
>        * required of a subclass.
>        *
>        * @param av {@inheritDoc}
> diff -r 099bb085017a
> src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
> ---
> a/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
> Mon Mar 06 08:57:41 2017 -0800
> +++
> b/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor6.java
> Tue Mar 07 01:27:26 2017 -0800
> @@ -111,7 +111,7 @@
>        *
>        * @implSpec The default implementation of this method in
>        * {@code AbstractElementVisitor6} will always throw
> -     * {@code UnknownElementException}.
> +     * {@code new UnknownElementException(e, p)}.
>        * This behavior is not required of a subclass.
>        *
>        * @param e {@inheritDoc}
> diff -r 099bb085017a
> src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
> ---
> a/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
> Mon Mar 06 08:57:41 2017 -0800
> +++
> b/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java
> Tue Mar 07 01:27:26 2017 -0800
> @@ -142,7 +142,7 @@
>        *
>        * @implSpec The default implementation of this method in {@code
>        * AbstractTypeVisitor6} will always throw {@code
> -     * UnknownTypeException}.  This behavior is not required of a
> +     * new UnknownTypeException(t, p)}.  This behavior is not required of a
>        * subclass.
>        *
>        * @param t  {@inheritDoc}
>
Loading...