`java.lang.reflect.Proxy::newProxyInstance` and `java.lang.invoke.MethodHandleProxies::asInterfaceInstance` do not specify how to deal with sealed interfaces. These APIs should reject sealed interface with `IllegalArgumentException` which is thrown if the given interface is invalid.
Please review CSR: https://bugs.openjdk.java.net/browse/JDK-8269396 ------------- Commit messages: - JDK-8269351: Proxy.newProxyInstance and MethodHandleProxies::asInterfaceInstance should reject sealed interfaces Changes: https://git.openjdk.java.net/jdk17/pull/148/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=148&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269351 Stats: 101 lines in 4 files changed: 97 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk17/pull/148.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/148/head:pull/148 PR: https://git.openjdk.java.net/jdk17/pull/148