-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
low
-
-
Java API
-
SE
Summary
Specify more explicitly the inputs to Types.getArrayType
which cause an IllegalArgumentException
to be thrown.
Problem
The full extent of the set of input which cause IllegalArgumentException
is unclear.
Solution
Augment the @throws
clause to contain more information.
Specification
diff --git a/src/java.compiler/share/classes/javax/lang/model/util/Types.java b/src/java.compiler/share/classes/javax/lang/model/util/Types.java
index ce83cda405862..bee52a5614c4a 100644
--- a/src/java.compiler/share/classes/javax/lang/model/util/Types.java
+++ b/src/java.compiler/share/classes/javax/lang/model/util/Types.java
@@ -263,7 +263,9 @@ public interface Types {
*
* @param componentType the component type
* @throws IllegalArgumentException if the component type is not valid for
- * an array, including executable, package, module, and wildcard types
+ * an array. All valid types are {@linkplain ReferenceType
+ * reference types} or {@linkplain PrimitiveType primitive types}.
+ * Invalid types include null, executable, package, module, and wildcard types.
* @jls 10.1 Array Types
*/
ArrayType getArrayType(TypeMirror componentType);
- csr of
-
JDK-8341483 Clarify special case handling of Types.getArrayType
-
- Resolved
-