vlsi commented on code in PR #6306:
URL: https://github.com/apache/jmeter/pull/6306#discussion_r1706460866
##########
src/protocol/java/src/main/java/org/apache/jmeter/protocol/java/sampler/JavaSampler.java:
##########
@@ -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());
Review Comment:
The exception can be the last parameter without a placeholder, and it will
render as a stacktrace, so `.getMessage` is not needed here.
```suggestion
log.error("{}\tException initialising: {}", whoAmI(), name, e);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]