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

Remove the static annotationNameCache from AnnotationUtils #2997

Merged
merged 10 commits into from Jan 2, 2020

Conversation

smillst
Copy link
Member

@smillst smillst commented Dec 17, 2019

  • Also adds version of areSameByClass, containsSameByClass, and getAnnotationByClass to AnnotatedTypeFactory that use a (non-static) cache.
  • Replace most calls to the AnnotationUtil methods with calls to the AnnotatedTypeFactory versions.

I didn't change the Value Checker because #2987 replaced most of those calls with calls to areSameByName. So, that PR should be merged first.

@smillst smillst assigned smillst and unassigned wmdietl Dec 18, 2019
@smillst smillst assigned wmdietl and unassigned smillst Dec 18, 2019
Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
It's a bit odd that the ATFs have AnnotationMirrors for the qualifiers, but then use class literals for equality comparisons. Eventually, we should look into cleaning this up some more.

/** Size of the annotationClassNames cache. */
private static final int ANNOTATION_CACHE_SIZE = 500;

/** Maps classes representing AnnotationMirrors to their names. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Canonical names, to make the value description more precise?

@wmdietl wmdietl assigned smillst and unassigned wmdietl Dec 19, 2019
@smillst smillst merged commit 3e0191f into typetools:master Jan 2, 2020
@smillst smillst deleted the areSameByClass branch January 2, 2020 22:52
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.

None yet

3 participants