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

[inspector] Handle InaccessibleObjectException for foreign-module fields #81

Merged
merged 1 commit into from
Dec 30, 2019

Conversation

alexander-yakushev
Copy link
Member

@alexander-yakushev alexander-yakushev commented Dec 24, 2019

On Java9+, when trying to inspect an object of a class that comes from the other module, and that object has private fields, JVM will throw InaccessibleObjectException when the inspector tries to set those private fields to accessible. Unfortunately, there doesn't seem a generic way to work around this, so at least we want the inspector to not crash in such situations.

Here's what the inspector shows after the patch:

image

@alexander-yakushev alexander-yakushev force-pushed the inaccessible-exception branch 2 times, most recently from 035afaa to 598f621 Compare December 24, 2019 16:08
(catch Exception e
;; We want to handle specifically SecurityException
;; and j.l.r.InaccessibleObjectException, but the
;; letter only comes with Java9+, so let's just
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

letter -> latter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂

@bbatsov
Copy link
Member

bbatsov commented Dec 24, 2019

Btw, please mention this in the changelog as well.

@alexander-yakushev
Copy link
Member Author

So, is it good enough now?

@bbatsov bbatsov merged commit 78e49b5 into master Dec 30, 2019
@bbatsov
Copy link
Member

bbatsov commented Dec 30, 2019

Yep. Thanks!

@alexander-yakushev alexander-yakushev deleted the inaccessible-exception branch April 22, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants