Skip to content

Commit

Permalink
ClassLoaderDefineClassPatcher patches also frozen classes
Browse files Browse the repository at this point in the history
  • Loading branch information
skybber committed Jan 26, 2025
1 parent 013a4d9 commit 5410bb1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ public void patch(final ClassLoader classLoaderFrom, final String pluginPath,
CtClass pluginClass = null;
try {
// force to load class in classLoaderFrom (it may not yet be loaded) and if the classLoaderTo
// is parent of classLoaderFrom, after definition in classLoaderTo will classLoaderFrom return
// is a parent of classLoaderFrom, after definition in classLoaderTo will classLoaderFrom return
// class from parent classloader instead own definition (hence change of behaviour).
InputStream is = new ByteArrayInputStream(pluginBytes);
pluginClass = cp.makeClass(is);
pluginClass = cp.makeClass(is, false);
try {
classLoaderFrom.loadClass(pluginClass.getName());
} catch (NoClassDefFoundError e) {
Expand Down

0 comments on commit 5410bb1

Please sign in to comment.