-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[MNG-7738] don't dump raw stack traces to System.err #1064
Conversation
@@ -73,8 +73,6 @@ public boolean matches(String requirement) { | |||
return range.getRecommendedVersion().compareTo(version) == 0; | |||
} | |||
} catch (InvalidVersionSpecificationException ex) { | |||
// TODO error reporting | |||
ex.printStackTrace(); | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this information is required, it should be ad debug log level
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish these classes were documented better, and I wish this one and several others were non-public. That said, it does seem it's used in only one other place where we do:
if (!matcher.matches(requirement.getValue())) {
getLog().debug("Toolchain " + this + " doesn't match required property: " + key);
return false;
}
That is, a false result already logs at debug level.
@@ -229,7 +229,7 @@ public ArtifactResolutionResult resolve(ArtifactResolutionRequest request) { | |||
.map(Dependency::new) | |||
.collect(Collectors.toList()); | |||
} catch (IOException e) { | |||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this is test code, debug logging seems too weak. If this is a problem worth paying attention to, or that might explain why a test has failed or flaked, then bubble the IOException to immediately fail the test with the root cause rather than waiting for it to fail down the line.
On the other hand, if the test shouldn't and doesn't fail when this exception is thrown, then no debug log is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On further investigation, this immensely over-engineered class is used in exactly one test method testCacheKey
which doesn't even enter this method when it runs.
No description provided.