Redefine the supplied set of classes using the supplied class files.
This method is used to replace the definition of a class without reference
to the existing class file bytes, as one might do when recompiling from source
for fix-and-continue debugging.
Where the existing class file bytes are to be transformed (for
example in bytecode instrumentation)
should be used.
This method operates on a set in order to allow interdependent changes to more than one class at the same time (a redefinition of class A can require a redefinition of class B).
If a redefined method has active stack frames, those active frames continue to run the bytecodes of the original method. The redefined method will be used on new invokes.
This method does not cause any initialization except that which would occur under the customary JVM semantics. In other words, redefining a class does not cause its initializers to be run. The values of static variables will remain as they were prior to the call.
Instances of the redefined class are not affected.
The redefinition may change method bodies, the constant pool and attributes. The redefinition must not add, remove or rename fields or methods, change the signatures of methods, or change inheritance. These restrictions maybe be lifted in future versions. The class file bytes are not checked, verified and installed until after the transformations have been applied, if the resultant bytes are in error this method will throw an exception.
If this method throws an exception, no classes have been redefined.
This method is intended for use in instrumentation, as described in the class specification.
|array of classes to redefine with corresponding definitions; a zero-length array is allowed, in this case, this method does nothing|
| if a specified class cannot be modified
| if the current configuration of the JVM does not allow
|if the data did not contain a valid class|
|if the name in the class file is not equal to the name of the class|
|if the class file version numbers are not supported|
|if the new classes contain a circularity|
|if a linkage error occurs|
| if the supplied definitions array or any of its components
|Can never be thrown (present for compatibility reasons only)|