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

PreferJavaTimeOverload:OFF #1094

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

iamdanfox
Copy link
Contributor

Before this PR

A bunch of our repos internally use custom assertj libraries (e.g. the c-j-r-api test-utils, audit logging test utils, safe-logging test-utils), which triggers this wonky error-prone behaviour: google/error-prone#1435

I even saw this pretty non-sensical message internally in sls-logging:

/Volumes/git/sls-logging/sls-logging-log4j/src/test/java/com/palantir/sls/logging/log4j/Log4jSlsLoggingSubscribersMetricsTest.java:143: warning: [PreferJavaTimeOverload] If the numeric primitive (eventLengthHistogram.getCount()) represents a Instant, please call assertThat(Instant) instead.
                    .untilAsserted(() -> assertThat(eventLengthHistogram.getCount()).isOne());

After this PR

==COMMIT_MSG==
The PreferJavaTimeOverload error-prone check is turned off to avoid false positives
==COMMIT_MSG==

Possible downsides?

@changelog-app
Copy link

changelog-app bot commented Dec 5, 2019

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

The PreferJavaTimeOverload error-prone check is turned off as it produces noisy false positives relating to custom AssertJ utilities.

Check the box to generate changelog(s)

  • Generate changelog entry

@@ -50,7 +50,8 @@
// Built-in checks
"ArrayEquals",
"MissingOverride",
"UnnecessaryParentheses");
"UnnecessaryParentheses",
"PreferJavaTimeOverload");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I think the checkExplicitlyDisabled function will actually prevent these auto-fixes being applied until we get rid of the explicit CheckSeverity.OFF setting... I'm kinda OK with just leaving this here so that when we re-enable the check it will start patching.

@carterkozak
Copy link
Contributor

👍

@bulldozer-bot bulldozer-bot bot merged commit dcd4332 into develop Dec 5, 2019
@bulldozer-bot bulldozer-bot bot deleted the dfox/suppress-prefer-java-time-overload branch December 5, 2019 23:28
@svc-autorelease
Copy link
Collaborator

Released 2.40.1

This was referenced Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants