Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible InaccessibleObjectExceptions during debugging session #7633

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading