Skip to content

Commit

Permalink
Merge pull request #7633 from mbien/fix-debugger-ioe_delivery
Browse files Browse the repository at this point in the history
Fix possible InaccessibleObjectExceptions during debugging session
  • Loading branch information
ebarboni authored Aug 6, 2024
2 parents 1e7ab53 + 9554655 commit f6423d2
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import java.io.InvalidObjectException;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.InaccessibleObjectException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -250,7 +250,12 @@ private static Object setFieldsValues(Object newInstance, Class clazz, Map<Field
logger.log(Level.CONFIG, "No Such Field({0}) of class {1}", new Object[]{name, clazz});
return null;
}
field.setAccessible(true);
try {
field.setAccessible(true);
} catch(InaccessibleObjectException ex) {
logger.log(Level.CONFIG, "InaccessibleObjectException({0}) of field {1}", new Object[]{ex.getLocalizedMessage(), field});
return null;
}
Value v = fieldValues.get(f);
try {
if (v == null) {
Expand Down

0 comments on commit f6423d2

Please sign in to comment.