Skip to content

Replace PolarisDiagnostics with Guava Preconditions #520

Closed
@snazy

Description

@snazy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions