Skip to content

Commit a6fd9cf

Browse files
committed
Fix IllegalStateException when class is not found
We need to pass the cause to the constructor, since ClassNotFoundException does not allow initCause to be called.
1 parent d9dce68 commit a6fd9cf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/java/org/scijava/command/CommandInfo.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,7 @@ public Class<?> loadDelegateClass() throws ClassNotFoundException {
300300
return loadClass();
301301
}
302302
catch (final InstantiableException exc) {
303-
final ClassNotFoundException cnfe = new ClassNotFoundException();
304-
cnfe.initCause(exc);
305-
throw cnfe;
303+
throw new ClassNotFoundException(null, exc);
306304
}
307305
}
308306

0 commit comments

Comments
 (0)