RFR [8059563]: (proxy) sun.misc.ProxyGenerator.generateProxyClass should create intermediate directories

Mandy Chung mandy.chung at oracle.com
Tue Oct 7 05:47:17 UTC 2014


On 10/6/2014 4:35 AM, Ivan Gerasimov wrote:
> Hello!
>
> This is a 7u-only fix.
>
> Some users complain about the ProxyGenerator not creating the 
> intermediate directories when asked to keep the generated files.
> It throws an IO exception instead
>
> The fix is essentially a part of JDK-8004260.
> That was a relatively big update, which required CCC, so it's not 
> feasible to port it as a whole.
>
> Would you please help review it?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8059563
> WEBREV: http://cr.openjdk.java.net/~igerasim/8059563/0/webrev/
>

The fix looks okay.

Typo in the new test line 26: s/intermidiate/intermediate.   It would be 
good to make sure the directory doesn't exist before generating the 
proxy class and also check if the expected file is created after it's 
generated.   An alternative is to call Proxy.getProxyClass instead 
ProxyGenerator as your test is under java/lang/reflect/Proxy.  Maybe the 
testname be renamed to "SaveProxyClassFileTest.java"

Mandy


More information about the jdk7u-dev mailing list