Invokable
no longer inherits from java.lang.reflect.AccessibleObject
.
#5569
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Invokable
no longer inherits fromjava.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 isprotected
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 implementsGenericDeclaration
.Invokable
does continue to provide instance methods with the same signatures as the ones inherited fromAccessibleObject
andGenericDeclaration
, 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 typeAccessibleObject
. 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 ofInvokable
overall.) Also, this API is@Beta
so a hypothetical-but-very-unlikely breakage is acceptable.RELNOTES=
Invokable
no longer inherits fromAccessibleObject
orGenericDeclaration
, 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.