Skip to content

Conversation

@carterkozak
Copy link
Contributor

Before this PR

Previously preconditions reused the same package as safe-logging
API, which is not allowed by the java platform module system.
While this change will impact a lot of code, we can automate the
transition in a relatively straightforward way, and eventually shift
the legacy jar to a runtime dependency to prevent new uses.

After this PR

==COMMIT_MSG==
Migrate the Preconditions utility to its own com.palantir.logsafe.preconditions package
==COMMIT_MSG==

Possible downsides?

Deprecation warnings (or build failures) when this library is upgraded.

Previously preconditions reused the same package as safe-logging
API, which is not allowed by the java platform module system.
While this change will impact a lot of code, we can automate the
transition in a relatively straightforward way, and eventualy shift
the legacy jar to a runtime dependency to prevent new uses.
@changelog-app
Copy link

changelog-app bot commented Jan 26, 2021

Generate changelog in changelog/@unreleased

Type

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

Description

Migrate the Preconditions utility to its own com.palantir.logsafe.preconditions package

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from jkozlowski January 26, 2021 19:00
@carterkozak
Copy link
Contributor Author

Moving the exceptions to their own jar makes it easier to justify adding the SafeUnsupportedOperationException I've always dreamed of...

carterkozak added a commit to palantir/gradle-baseline that referenced this pull request Jan 26, 2021
See palantir/safe-logging#515

This change does two things:
* The existing errorprone checks which reference preconditions
  have been updated to suggest the new package name
* A new `SafeLoggingPreconditionsMigration` check has been added
  to automatically migrate code to the new package when a
  sufficiently new `safe-logging` version is available.
Copy link
Contributor

@jkozlowski jkozlowski left a comment

Choose a reason for hiding this comment

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

Let's gooo. I'm assuming there's no alternative

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants