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

Invokable no longer inherits from java.lang.reflect.AccessibleObject. #5569

Merged
merged 0 commits into from
May 24, 2021

Conversation

copybara-service[bot]
Copy link
Contributor

Invokable no longer inherits from java.lang.reflect.AccessibleObject.

There was no strong reason for this inheritance. Additionally, it is an accident that AccessibleObject is subclassable at all outside its class; its constructor is protected but should really have been package-private. That's an API mistake that was made in Java 1.2 and is hard to correct now, but the protected constructor is being deprecated. (My related rant from 15 years ago is here.)

Invokable also no longer implements GenericDeclaration.

Invokable does continue to provide instance methods with the same signatures as the ones inherited from AccessibleObject and GenericDeclaration, as they stood in Java 8.

This change is technically a breaking API change. In principle users could have assigned an instance of Invokable to a variable of type AccessibleObject. No code does that in Google's giant code base so it seems unlikely in practice. (In fact we only have a couple of dozen uses of Invokable overall.) Also, this API is @Beta so a hypothetical-but-very-unlikely breakage is acceptable.

RELNOTES=Invokable no longer inherits from AccessibleObject or GenericDeclaration, though it continues to define instance methods with the same signatures as the formerly-inherited ones. This is technically a breaking API change to this @Beta API. We think it very unlikely that anyone is affected in practice.

@google-cla google-cla bot added the cla: yes label May 24, 2021
@copybara-service copybara-service bot force-pushed the test_375191535 branch 2 times, most recently from c0456e5 to 2edd694 Compare May 24, 2021 21:47
@copybara-service copybara-service bot closed this May 24, 2021
@copybara-service copybara-service bot merged commit 12af215 into master May 24, 2021
@copybara-service copybara-service bot deleted the test_375191535 branch May 24, 2021 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants