-
CSR
-
Resolution: Approved
-
P3
-
None
-
minimal
-
No change to the behavior of `Proxy::newProxyInstance`.
-
Java API
-
SE
Summary
Update the spec of Proxy::newProxyInstance
to specify `IllegalArgumentException thrown if a given proxy interface is hidden.
Problem
The current spec of Proxy::newProxyInstance
throws IAE if a given proxy interface cannot be found by the given class loader. This covers for the case of a hidden proxy interface since it is not discoverable by any class loader. It should explicitly list in the restrictions section that the given interfaces must be non-hidden interfaces.
Solution
Update the spec of Proxy::newProxyInstance
to require all proxy interfaces be non-hidden. There is no behavioral change. The current implementation already throws IAE if any one of the given interfaces is hidden.
Specification
Update the spec of Proxy::newProxyInstance
* <a id="restrictions">{@code IllegalArgumentException} will be thrown
* if any of the following restrictions is violated:</a>
* <ul>
* <li>All of {@code Class} objects in the given {@code interfaces} array
- * must represent interfaces, not classes or primitive types.
+ * must represent {@linkplain Class#isHidden() non-hidden} interfaces,
+ * not classes or primitive types.
- csr of
-
JDK-8250219 Proxy::newProxyInstance spec should specify the behavior if a given proxy interface is hidden
-
- Resolved
-