-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
the NPE exception was already being thrown, but it wasn't properly documented in the spec
-
Java API
-
SE
Summary
Method java.lang.constant.MethodTypeDesc::ofConstructor should have precise assertions for the cases for which a NullPointerException can be thrown
Problem
Method java.lang.constant.MethodTypeDesc::ofConstructor doesn't have precise assertions for the cases for which a NullPointerException can be thrown.
Solution
Update the specification to indicate in a precise way when a NPE can be thrown
Specification
diff -r b99e97bc5040 -r 95a9343e7881 src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java
--- a/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java Wed May 15 08:58:23 2019 -0400
+++ b/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java Thu May 16 12:50:11 2019 -0400
@@ -177,7 +177,7 @@
* @param paramTypes {@link ClassDesc}s describing the parameter types of
* the constructor
* @return the {@linkplain MethodHandleDesc}
- * @throws NullPointerException if any of the arguments are null
+ * @throws NullPointerException if any argument or its contents is {@code null}
*/
static DirectMethodHandleDesc ofConstructor(ClassDesc owner,
ClassDesc... paramTypes) {
- csr of
-
JDK-8223726 j.l.c.MethodTypeDesc spec should contain precise assertions for one parameter's methods
- Resolved