Skip to content

Commit a524ed2

Browse files
committed
AbstractModuleItem: lean on loadDelegateClass()
Now that ModuleInfo has a handy method for loading its module's delegate class, we can use it directly rather than relying on the unsafe and problematic usage of the ClassUtils#loadClass method.
1 parent de72621 commit a524ed2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/scijava/module/AbstractModuleItem.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,13 @@ public void setValue(final Module module, final T value) {
266266
// -- Internal methods --
267267

268268
protected Class<?> getDelegateClass() {
269-
return ClassUtils.loadClass(info.getDelegateClassName());
269+
try {
270+
return info.loadDelegateClass();
271+
}
272+
catch (final ClassNotFoundException exc) {
273+
// TODO: Consider a better error handling mechanism here.
274+
throw new IllegalStateException(exc);
275+
}
270276
}
271277

272278
}

0 commit comments

Comments
 (0)