RFR (XS): 8066497: Update c.o.j.t.ByteCodeLoader to be able really reload given class

David Chase david.r.chase at oracle.com
Tue Dec 9 20:49:13 UTC 2014


I agree with your changes to loadClass, but I am not sure that this will allow you to redefine an existing class.  My understanding of how this would work is that it will allow you re-obtain the class that was already loaded (but not to fail at this).  Actually redefining a class requires use of JVMTI (or so I think).

Was that your intent?

David


On 2014-12-09, at 11:50 AM, Pavel Chistyakov <pavel.chistyakov at oracle.com> wrote:

> Hi all,
> 
> please review changes for: https://bugs.openjdk.java.net/browse/JDK-8066497
> webrev: http://cr.openjdk.java.net/~iignatyev/pchistyakov/8066497/webrev.00/ <http://cr.openjdk.java.net/%7Eiignatyev/pchistyakov/8066497/webrev.00/>
> 
> Problem:
> ByteCodeLoader allows one to load class with given name from existing bytecode. But if this class is already loaded by e.g. system classloader it cannot be redefined using another bytecode array because of delegation of loadClass call to parent classloader.
> 
> Solution:
> override loadClass to break delegation for given className.
> 
> Testing: manual
> 
> -------------------
> Thanks,
> Pavel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20141209/a11c4f3b/signature.asc>


More information about the hotspot-compiler-dev mailing list