Avoid looking up annotation types during type matching #5906
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.
Part of #5791
Like jdk, byte-buddy getDeclaredAnnotations does not report annotations whose class is missing. To do this it needs to locate the bytes for annotation types used in class. Which means that if we have a matcher that matches methods annotated with
@Foo
byte-buddy will end up location bytes for all annotations used on any method in the classes that this matcher is applied to. From our perspective this is unreasonable, we just want to match based on annotation name with as little overhead as possible. As we match only based on annotation name we never need to locate the bytes for the annotation type.Implementation is a bit of a hack, so we'll have to consider whether we want to do this at all.