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 method checks to also look into superclasses if method was overridden #100

Closed
uschindler opened this issue May 22, 2016 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@uschindler
Copy link
Member

uschindler commented May 22, 2016

While testing Java 9, I found the following bug:

The tests for AccessibleObject#setAccessible() were not finding violations on Java 9 anymore. The reason is that Jigsaw overrides AccessibleObject#setAccessible() in the Executable subclass. Because of that the signature was already seen before and forbiddenapis did not look into superclasses. So the violation was not found (1 test failed).

This is a general bug of forbiddenapis, the old checks were easily able to break if a forbidden method was overridden by a subclass!

This fix removes the check that prevented looking into superclasses. Fields are not affected, because fields are never "virtual", so the "optimization" can stay.

@uschindler uschindler added the bug label May 22, 2016
@uschindler uschindler added this to the 2.1 milestone May 22, 2016
@uschindler uschindler self-assigned this May 22, 2016
uschindler added a commit that referenced this issue May 22, 2016
…es and duplicate constructors (they are never virtual)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant