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

Generated GlideOptions are missing annotations #2774

Open
TWiStErRob opened this issue Dec 31, 2017 · 3 comments
Open

Generated GlideOptions are missing annotations #2774

TWiStErRob opened this issue Dec 31, 2017 · 3 comments

Comments

@TWiStErRob
Copy link
Collaborator

Glide Version: 4.5.0-SNAPSHOT

Integration libraries: none

Device/Android Version: none

Issue details / Repro steps / Use case background: Just looking around and noticed that com.bumptech.glide.request.RequestOptions#centerCrop has a warning on it saying "overriding methods are missing @NonNull". I checked where and it turns out it's from APT code. FlickrGlideExtension defines some of those methods, I wonder if it should warn/fail during processing that it's missing an annotation, or just add it automatically. Probably latter since all RequestOptions returning methods are builders and need to chain. On the other hand not having @NonNull in the extension class allows to return null without warning.

Glide load line / GlideModule (if any) / list Adapter code (if any):
https://github.com/bumptech/glide/blob/v4.4.0/samples/flickr/src/main/java/com/bumptech/glide/samples/flickr/FlickrGlideExtension.java

@TWiStErRob
Copy link
Collaborator Author

See also com.bumptech.glide.RequestManager#as

@sjudd
Copy link
Collaborator

sjudd commented Dec 31, 2017

Yeah and embarrassingly the centerCrop that's in that code is for testing and shouldn't have been committed :/.

sjudd added a commit to sjudd/glide that referenced this issue Dec 31, 2017
sjudd added a commit to sjudd/glide that referenced this issue Dec 31, 2017
sjudd added a commit to sjudd/glide that referenced this issue Dec 31, 2017
@sjudd
Copy link
Collaborator

sjudd commented Dec 31, 2017

I'll add @nonnull by default to any methods generated from extensions and also warn if the extension itself is missing the annotation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants