David - I think the test fails even in your first version.
It should use ProxyClashTest.class.getClassLoader() to define the proxy
class as the test is running in agent vm mode.
Mandy
On 3/14/18 2:31 PM, Aleksey Shipilev wrote:
Have you tried to run the test
Because it fails:
$ make images run-test TEST=jdk/java/lang/reflect/Proxy/ProxyClashTest.java
Dynamic proxy API static method clash test
java.lang.IllegalArgumentException: ProxyClashTest$ClashWithRunnable referenced
from a method is not
visible from class loader
at
java.base/java.lang.reflect.Proxy$ProxyBuilder.ensureVisible(Proxy.java:851)
at
java.base/java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:682)
at java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:628)
at
java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$1(Proxy.java:426)
at
java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
at
java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:424)
at java.base/java.lang.reflect.Proxy.getProxyClass(Proxy.java:384)
at ProxyClashTest.main(ProxyClashTest.java:56)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at
com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:229)
at java.base/java.lang.Thread.run(Thread.java:841)
JavaTest Message: Test threw exception: java.lang.IllegalArgumentException
JavaTest Message: shutting down test
Thanks,
-Aleksey