Skip to content

Commit

Permalink
tidyup
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjwalls committed Nov 26, 2024
1 parent c48e06b commit 1dd190f
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -958,13 +958,11 @@ public Object invoke(String opName, Object[] opArgs, String[] sig)

if (opClassName != null) {
try {
final Object obj = targetObject;
final String className = opClassName;
final ClassNotFoundException[] caughtException = new ClassNotFoundException[1];

final ClassLoader targetClassLoader = obj.getClass().getClassLoader();
final ClassLoader targetClassLoader = targetObject.getClass().getClassLoader();
try {
targetClass = Class.forName(className, false, targetClassLoader);
targetClass = Class.forName(opClassName, false, targetClassLoader);
} catch (ClassNotFoundException e) {
caughtException[0] = e;
}
Expand Down Expand Up @@ -1095,15 +1093,14 @@ private Method findRMMBMethod(String opMethodName,
if (opClassName == null)
targetClass = rmmbClass;
else {
final String className = opClassName;
final ClassLoader targetClassLoader = rmmbClass.getClassLoader();
try {
Class<?> clz = Class.forName(className, false,
targetClassLoader);
if (!rmmbClass.isAssignableFrom(clz))
Class<?> clz = Class.forName(opClassName, false, targetClassLoader);
if (!rmmbClass.isAssignableFrom(clz)) {
targetClass = null;
else
} else {
targetClass = clz;
}
} catch (ClassNotFoundException e) {
}
}
Expand Down Expand Up @@ -2607,7 +2604,7 @@ private Class<?> loadClass(final String className)
final ClassLoaderRepository clr = getClassLoaderRepository();
try {
if (clr == null) throw new ClassNotFoundException(className);
return clr.loadClass(className);
return clr.loadClass(className);
} catch (ClassNotFoundException ex) {
caughtException[0] = ex;
}
Expand Down

0 comments on commit 1dd190f

Please sign in to comment.