Skip to content

Annotation hierarchies - #1421

Merged
BoykoAlex merged 1 commit into
mainfrom
annotation-hierarchies
Dec 5, 2024
Merged

BoykoAlex merged 1 commit into
mainfrom
annotation-hierarchies

Conversation

@BoykoAlex

Copy link
Copy Markdown
Contributor

Addresse #1288

@BoykoAlex
BoykoAlex force-pushed the annotation-hierarchies branch from 1539b9c to 5752db7 Compare December 5, 2024 03:51
@BoykoAlex
BoykoAlex marked this pull request as ready for review December 5, 2024 03:51
@BoykoAlex

BoykoAlex commented Dec 5, 2024 •

Copy link
Copy Markdown
Contributor Author

@martinlippert this seems to work. I've discovered that ITypeBinding.getKey() returning binding key string is computed once and then cached proves to be very useful as it eliminates costly getQualifiedName() calls and delivers something that can be used as annotation's FQN as for annotation types it easy to convert FQN <-> Binding key (i.e. foo.bar.A <-> Lfoo/bar/A), JavaUtils class has methods for simple conversions. Therefore, I'd go even further and put binding keys in AnnotationTypeInformation as we seem to only care about whether binding is annotated with annotation given by its FQN and all annotations as an Iterator/Collection of IAnnotationBinding. We can still have the method taking FQN as a parameter but it'd delegate to the method taking binding key as a parameter (since we can convert FQN to binding key). In addition I'd also switch AnnotationHierarchyAwareLookup.bindings map to have keys as binding keys rather than FQN - this will greatly decrease the number of ITypeBinding.getQualifiedName() calls. This would be the last thing I'd do on this topic.

@BoykoAlex
BoykoAlex force-pushed the annotation-hierarchies branch from 5752db7 to 4726caa Compare December 5, 2024 16:04
@BoykoAlex
BoykoAlex merged commit 78dc6f3 into main Dec 5, 2024
@BoykoAlex

Copy link
Copy Markdown
Contributor Author

Merging what I have a the moment and then working on switching to binding key under the hood instead of FQN without changing the API that accepts FQN parameter.

@martinlippert
martinlippert deleted the annotation-hierarchies branch November 19, 2026 13:07
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.

1 participant