Skip to content

Commit

Permalink
fix invoke with varargs
Browse files Browse the repository at this point in the history
Signed-off-by: Megrez Lu <[email protected]>
  • Loading branch information
lujiajing1126 committed Feb 1, 2024
1 parent 820fb97 commit 9cbba6c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,14 @@ public static Class defineClass(String className, byte[] b, ClassLoader loader,
protectionDomain = PROTECTION_DOMAIN;
}
try {
c = (Class) unreflect.invoke(loader, className, b, 0, b.length, protectionDomain);
List args = new ArrayList(6);
args.add(loader);
args.add(className);
args.add(b);
args.add(0);
args.add(b.length);
args.add(protectionDomain);
c = (Class) unreflect.invokeWithArguments(args);
} catch (InvocationTargetException ex) {
throw new ReflectException(ex.getTargetException());
} catch (Throwable ex) {
Expand Down

0 comments on commit 9cbba6c

Please sign in to comment.