JDK 9 RFR of JDK-8176266: Mae visitUnknown specification more explicit
joe darcy
joe.darcy at oracle.com
Tue Mar 7 09:27:52 UTC 2017
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}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20170307/5d6371b6/attachment.html>
More information about the compiler-dev
mailing list