JDK-8066497 : Update c.o.j.t.ByteCodeLoader to be able really reload given class
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-12-02
  • Updated: 2015-06-03
  • Resolved: 2014-12-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b47Fixed
Related Reports
Blocks :  
Description
Problem: we need to redefine class w/ given name from existing byte code. loadClass first tries to load class using parent or bootstrap classloader and doesn't really reload class as new.
Solution: override loadClass to break delegation for given className.
Comments
If the class is restricted to the user-defined ByteCodeLoader then there is no need to break delegation as the parent loaders should not be able to find it. If the parent loaders can find it then there seems to be a problem with the way things are being set up.
09-12-2014

I meant load class from bytecode using new instance of ByteCodeLoader, of course. Sorry for inaccurate description.
08-12-2014

You can't reload a class that is already loaded - even if you override loadClass to attempt it, the defineClass will fail. To reload a class you need to use a different classloader for each of the variants loaded, and they must be siblings not ancestors/descendents.
04-12-2014