I research following JDK method:
java.lang.reflect.Field#get
it throws IllegalAccessException
if the underlying field is inaccessible.
Am I right I can protect my code against the exception if I will add following line
field.setAccessible(true);
?
Is there another ways to get this exception?
Aucun commentaire:
Enregistrer un commentaire