-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fixes for several string formats, they are based on static analysis. #6306
base: master
Are you sure you want to change the base?
Changes from all commits
441ad6e
23641f6
e557c1c
bc06523
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -121,9 +121,9 @@ private void initClass() { | |||||
javaClass = Class.forName(name, false, Thread.currentThread().getContextClassLoader()); | ||||||
Method method = javaClass.getMethod("teardownTest", JavaSamplerContext.class); | ||||||
isToBeRegistered = !method.getDeclaringClass().equals(AbstractJavaSamplerClient.class); | ||||||
log.info("Created class: {}. Uses tearDownTest: ", name, isToBeRegistered); | ||||||
log.info("Created class: {}. Uses tearDownTest: {}", name, isToBeRegistered); | ||||||
} catch (Exception e) { | ||||||
log.error("{}\tException initialising: ", whoAmI(), name, e); | ||||||
log.error("{}\tException initialising: {} {}", whoAmI(), name, e.getMessage()); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exception can be the last parameter without a placeholder, and it will render as a stacktrace, so
Suggested change
|
||||||
} | ||||||
|
||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -504,7 +504,7 @@ private void closeSocket(String socketKey) { | |
try { | ||
con.close(); | ||
} catch (IOException e) { | ||
log.warn("Error closing socket {}", e); //$NON-NLS-1$ | ||
log.warn("Error closing socket", e); //$NON-NLS-1$ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, I think it is better to keep the short (string version) of the message 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.
Do we want the complete stacktrace to be shown 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.
The last "exception" parameter should not be present in the string format message, so
("Could not create binary file", e);
is the right way to go to show the stacktrace