Skip to content

Commit 6832ccc

Browse files
slandelleigr
authored andcommitted
Make ClassUtil#forceOpen trap all RuntimeException
Motivation: Starting Java 9, this piece of code can also throw a java.lang.reflect.InaccessibleObjectException. Modification: As this Exception appeared in Java 9 and jodd is compatible with Java 8, we have no choice but to trap the parent class which is RuntimeException. Result: Jodd reflection doesn't choke on unopened classes.
1 parent 14dc88e commit 6832ccc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/jodd/util/ClassUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ public static void forceAccess(final AccessibleObject accObject) {
510510
return null;
511511
});
512512
}
513-
} catch (final SecurityException sex) {
513+
} catch (final RuntimeException ex) {
514514
// ignore
515515
}
516516
}

0 commit comments

Comments
 (0)