Errorprone checks

32 views
Skip to first unread message

Eric Stevenson

unread,
Nov 12, 2018, 3:34:02 PM11/12/18
to ja...@chromium.org
Planning to add some more Errorprone checks:
Any objections? Are there other Errorprone checks that folks think would be useful?

Thanks,
Eric

Nate Fischer

unread,
Nov 12, 2018, 5:07:19 PM11/12/18
to estev...@chromium.org, ja...@chromium.org
Excited to enforce the correct @Nullable import. Can you do the same for @NonNull imports (or, ban them outright if we want to assume @NonNull by default)?

As an extra bonus, it would be great if our compiler could enforce @NonNull's semantics. I've heard of 3rd party plugins (uber/NullAway)--not sure if we're planning to use this, however.

Nate Fischer | Software Engineer | ntf...@google.com



--
You received this message because you are subscribed to the Google Groups "java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java+uns...@chromium.org.
To post to this group, send email to ja...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/java/CACO9cobFtP8CzGB%2BYdA9Wu7pog971GebWxKKy1h0F-e1MT2brg%40mail.gmail.com.

Tommy Nyquist

unread,
Nov 13, 2018, 12:12:35 AM11/13/18
to Nate Fischer, twell...@chromium.org, hua...@chromium.org, estev...@chromium.org, ja...@chromium.org
Adding the checks you mentioned for @Nullable and exceptions SGTM.

Regarding the Drawable check, any thoughts on this, twellington@ or huayinz@?

Boris Sazonov

unread,
Nov 13, 2018, 9:26:16 AM11/13/18
to Tommy Nyquist, ntf...@google.com, Theresa Wellington, hua...@chromium.org, estev...@chromium.org, ja...@chromium.org
Thanks for doing that, Eric! We definitely need more checks for our Java codebase.

+1 for AppCompatResources.getDrawable check. Related internal discussion. By the way, is it much harder to make it a custom Lint check? Ideally, this check should be one of Support Library Lint checks.

For Chrome-specific checks, it would make sense to check that Chrome widget classes don't directly extend ImageView/ImageButton/AppCompatImageView/AppCompatImageButton, subclassing ChromeImageView/ChromeImageButton instead (see https://crbug.com/894770).

Peter Wen

unread,
Nov 14, 2018, 8:38:47 AM11/14/18
to bsaz...@chromium.org, nyq...@chromium.org, Nate Fischer, twell...@chromium.org, hua...@chromium.org, estev...@chromium.org, ja...@chromium.org
We currently have quite a few custom errorprone checks, but as far as I am aware, no custom lint checks.

Unfortunately it seems like the custom lint API is not stable, so custom errorprone checks are preferred.

Thanks,

Peter

Reply all
Reply to author
Forward
0 new messages