Skip to content

Conversation

@Capstan
Copy link
Contributor

@Capstan Capstan commented Dec 5, 2021

This introduces use of the errorprone plugin as described at https://errorprone.info/docs/installation#maven. The warnings can then be addressed, @SuppressWarnings(…)ed, or if desired, have entire classes of warnings turned off. Then once the codebase is clean, the warnings can be treated as errors. This will reduce the drift between github and the monorepo, which generally tries to enforce errorprone cleanliness.

Related to #590.

@Capstan Capstan requested a review from a team as a code owner December 5, 2021 00:33
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 5, 2021
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/java-datastore API. label Dec 5, 2021
@Capstan Capstan changed the title Add errorprone warnings. style: Add errorprone warnings. Dec 5, 2021
@Capstan Capstan force-pushed the errorprone branch 3 times, most recently from a796401 to 585e117 Compare December 22, 2021 19:35
@Capstan
Copy link
Contributor Author

Capstan commented Dec 22, 2021

I've adapted my original PR to use profiles to only apply ErrorProne to JDK 9 and beyond. I don't think the GraalVM test failure is my doing, as it appears to be missing some configuration file I've not touched. I believe this is ready for review.

@Capstan Capstan force-pushed the errorprone branch 3 times, most recently from fe8ca1b to 3077aa2 Compare January 26, 2022 17:35
@Capstan
Copy link
Contributor Author

Capstan commented Feb 1, 2022

I believe this is again ready for review.

@Capstan
Copy link
Contributor Author

Capstan commented Feb 12, 2022

ping

suztomo
suztomo previously approved these changes Feb 15, 2022
@suztomo suztomo dismissed their stale review February 15, 2022 18:23

mistake

@Capstan
Copy link
Contributor Author

Capstan commented Feb 15, 2022

Oh, so close 😮

Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

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

LGTM with one remaining question

pom.xml Outdated
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>8</source>
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious if we need this since this profile is for jdk 9+ only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, possibly not. I think I can just use

<configuration>
  <release>9</release>
</configuration>

Lemme try that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Latest version uses that and seems to be fine with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was under the understanding if you didn't have either <source> or <target> or <release>, the default behavior was that it was treated as Java 6 (i.e., 1.6), but perhaps that was in earlier releases of Java? Anyway, removing it also works.

@Capstan Capstan force-pushed the errorprone branch 2 times, most recently from 1aae18b to 9057499 Compare March 9, 2022 16:34
Copy link
Contributor

@kolea2 kolea2 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@kolea2 kolea2 added automerge Merge the pull request once unit tests and other checks pass. owlbot:run Add this label to trigger the Owlbot post processor. labels Mar 9, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 9, 2022
@kolea2 kolea2 added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 9, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 9, 2022
@kolea2 kolea2 merged commit 77f4832 into googleapis:main Mar 9, 2022
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: datastore Issues related to the googleapis/java-datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants