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

Migrate from spotbugs to errorprone #3122

Merged
merged 5 commits into from
May 28, 2021

Conversation

anuraaga
Copy link
Contributor

Consistent with SDK, prints errors to console instead of file, and easier to SuppressWarnings

@@ -102,7 +102,7 @@ public static void onEnter(
}

// Assume already instrumented event if traceId is present.
if (!mdc.contains(TRACE_ID)) {
if (!mdc.containsValue(TRACE_ID)) {
Copy link
Member

Choose a reason for hiding this comment

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

Ouch, that's a bug - it should've been containsKey() right from the start

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error prone to the rescue!


} catch (Exception e) {
log.debug("Instrumentation error in tracing consumer", e);
try {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: we can use try-with-resources here

Copy link
Member

Choose a reason for hiding this comment

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

done (so I can merge this before #3118)

Comment on lines -74 to -75
// TODO this is very unusual code structure for this repo
// We have to review it
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

Consistent with SDK

❤️

And great clean-ups 👍

@trask trask merged commit ed88cca into open-telemetry:main May 28, 2021
robododge pushed a commit to robododge/opentelemetry-java-instrumentation that referenced this pull request Jun 17, 2021
* Migrate from spotbugs to errorprone

* Fix hashtable

* try-with-resources

* Fix from merge

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
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