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

Rename TypeHierarchy#isSubtype to TypeHierarchy#isSubtypeOrConvertible #709

Closed
wants to merge 3 commits into from

Conversation

smillst
Copy link
Member

@smillst smillst commented May 10, 2016

TypeHierarchy#isSubtype(AnnotatedTypeMirror, AnnotatedTypeMirror) is implemented to accept combinations of AnntotatedTypeMirrors where the underlying Java types are not subtypes, but are convertible. For example AnnotatedDeclaredType, AnnotatedPrimitiveType, see implementation here. So the name should really be isSubtypeOrConvertible.

It would make the transition easier if isSubtype could be deprecated, but because TypeHierarchy is an interface, then all implementations would have to implement both isSubtype and isSubtypeOrConvertible. And then once isSubtype is removed, the implementations would have to change again. It's really a question of whether we think more clients call TypeHierarchy#isSubtype than implement TypeHierarchy. I would appreciate input on this.

Most of the changes are from automatic refactoring. I also improved the Javadoc on isSutypeOrConvertible, which should be reviewed more carefully than the other changes.

@smillst smillst self-assigned this May 11, 2016
@smillst
Copy link
Member Author

smillst commented May 12, 2016

Instead of renaming the method, I'll document which conversion are performed by isSubtype and how they are preformed

@smillst smillst closed this May 12, 2016
@smillst smillst deleted the isSubTypeRenaming branch May 12, 2016 15:32
wmdietl pushed a commit to flo2702/checker-framework that referenced this pull request Apr 6, 2024
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