oblac / jodd-util

Essential Java utilities.
https://util.jodd.org
BSD 2-Clause "Simplified" License
39 stars 9 forks source link

Make ClassUtil#forceOpen trap all RuntimeException #20

Closed slandelle closed 8 months ago

slandelle commented 8 months ago

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.

igr commented 8 months ago

Thanx, I just released a new version! Do you need me to release any other project that uses util?

slandelle commented 8 months ago

Thanks a lot! No need to release the other libs for me, that's what dependency management is for 😄