Code review request for 6468534 "(reflect) Exception types cannot be parameterized, rephrase getGenericExceptionTypes"
Joe Darcy
Joe.Darcy at Sun.COM
Tue Sep 22 04:44:17 UTC 2009
Hello.
Please review my simple fix below for 6468534 "(reflect) Exception types
cannot be parameterized, rephrase getGenericExceptionTypes."
As documented in the JLS, "It is a compile-time error if a generic class
is a direct or indirect subclass of |Throwable|."
http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.2
Therefore, it is at most vacuously true for the {Constructor,
Method}.getGenericExceptionTypes to state "If an exception type is a
parameterized type..." and it would be clearer if this text were deleted.
-Joe
--- old/src/share/classes/java/lang/reflect/Constructor.java
2009-09-21 21:42:21.000000000 -0700
+++ new/src/share/classes/java/lang/reflect/Constructor.java
2009-09-21 21:42:20.000000000 -0700
@@ -275,10 +275,6 @@
* Returns an array of length 0 if the underlying method declares
* no exceptions in its {@code throws} clause.
*
- * <p>If an exception type is a parameterized type, the {@code Type}
- * object returned for it must accurately reflect the actual type
- * parameters used in the source code.
- *
* <p>If an exception type is a type variable or a parameterized
* type, it is created. Otherwise, it is resolved.
*
--- old/src/share/classes/java/lang/reflect/Method.java 2009-09-21
21:42:22.000000000 -0700
+++ new/src/share/classes/java/lang/reflect/Method.java 2009-09-21
21:42:21.000000000 -0700
@@ -317,10 +317,6 @@
* Returns an array of length 0 if the underlying method declares
* no exceptions in its {@code throws} clause.
*
- * <p>If an exception type is a parameterized type, the {@code Type}
- * object returned for it must accurately reflect the actual type
- * parameters used in the source code.
- *
* <p>If an exception type is a type variable or a parameterized
* type, it is created. Otherwise, it is resolved.
*
More information about the core-libs-dev
mailing list