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

Replace PolarisDiagnostics with Guava Preconditions #520

Open
1 task done
snazy opened this issue Dec 10, 2024 · 0 comments
Open
1 task done

Replace PolarisDiagnostics with Guava Preconditions #520

snazy opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@snazy
Copy link
Member

snazy commented Dec 10, 2024

Is this a possible security vulnerability?

  • This is NOT a possible security vulnerability

Describe the bug

The only implementation of PolarisDiagnostics is a rather wrapper around Guava's Preconditions. Instance(s) of PolarisDiagnostics are carried around in a bunch of places. Just carrying around this instance to wrap the common Preconditions is unnecessary and leads to a lot of rather unnecessary code.

Replacing PolarisDiagnostics(Impl) with plain calls to Preconditions simplifies the code base in a lot of places.

RuntimeExceptions can always be caught properly at the service level or even below and handled accordingly. If finer grained handling is necessary, it's better to have implicit/injected tracing mechanisms in place, which is more robust and clearer than manual implementations.

The change should also use the opportunity and replace the rather cryptic messages with messages that provide meaningful information to users and ideally also actionable information.

NB: This change would also remove the last usage of the Jetbrains-annotations dependency.

@snazy snazy added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant