Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Conversation

@maciejwalkowiak
Copy link
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

This is a proposal - if we decide to disable this check, same changes to other modules will have to be applied.

Disables ErrorProne check for JdkObsolete.

💡 Motivation and Context

Since must stay compatible with older Android APIs we are going to use classes like java.util.Date that ErrorProne marks as JdkObsolete and logs a warning. Warnings are treated as errors, so our build fails.

We can mark methods that use obsolete classes explicitly with @SurpressWarnings("JdkObsolete") - but this isn't clear at first and ideally there should be also a comment explaining why this annotation is there, or we can disable this check globally - as anyway there is a low likelihood that any of the obsolete classes - other than these that we must use - will be used.

Related discussion #511 (comment)

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • All tests passing
  • No breaking changes

🔮 Next steps

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

I have mixed feelings about this. I believe I'd rather keep declaring the obsoletes but with a comment to what they are about.

Maybe @marandaneto has thoughts?

@marandaneto
Copy link
Contributor

I have mixed feelings about this. I believe I'd rather keep declaring the obsoletes but with a comment to what they are about.

Maybe @marandaneto has thoughts?

would it be possible to disable it only for java.util.Date? I understand the need for it, but we lose other checks that might allow us to make mistakes, not only about compatibility with older Android versions but also choosing less performative objects, etc...

@maciejwalkowiak
Copy link
Contributor Author

As far as I am aware there is no option to disable check for single class. I understand the reasoning to keep it, the question is - shall we document each usage of @SuppressWarnings("JdkObsolete") with a proper comment?

@marandaneto
Copy link
Contributor

As far as I am aware there is no option to disable check for single class. I understand the reasoning to keep it, the question is - shall we document each usage of @SuppressWarnings("JdkObsolete") with a proper comment?

that sounds a solution, I'll add it to my list and see if I can remember the reason for all of them :D
should we close this then? thanks for bringing up the discussion though.

@maciejwalkowiak
Copy link
Contributor Author

Yep 👍 Closing.

@bruno-garcia bruno-garcia deleted the disable-jdkobsolete-check branch August 24, 2020 15:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants