code review request: 7054428: test/java/security/SecureClassLoader/ error

Alan Bateman Alan.Bateman at
Wed Jun 15 03:56:29 PDT 2011

Weijun Wang wrote:
> Without L104, array is empty, and L108 and L112 fill zeros into buffers.
> I also just noticed that the dummy class loaders are only used in 
> samevm. When running as othervm or standalone, findClass() method is 
> never called.
> It seems in othervm mode, the TestClass.class is in the same directory 
> as the main class and it's loaded directly by the URLClassLoader (?).
> I've updated the code changes to first rename the compiled file, so 
> that the URLClassLoader will be find it. The new test runs OK for both 
> samevm and othervm. I've even added a counter to make sure dummy class 
> loader get used.
I assume the original author just didn't realize that delegation meant 
that TestClass was being loaded by the parent loader.

Anyway, the changes look okay to me. I guess an alternative would be to 
compile TestClass into a different directory rather than renaming it.

Now back to the original issue. My guess is that it was failing in 
samevm mode because readClassFile leaves the file open and it would be 
good to fix that. We might also need to do something with the file mapping.


More information about the security-dev mailing list