gnodet-bot commented on code in PR #14177:
URL: https://github.com/apache/maven/pull/14177#discussion_r4737004095
##########
impl/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java:
##########
@@ -306,8 +306,10 @@ private void callDelegates(
delegate.setupRealm(classRealm, request);
} catch (Exception e) {
logger.error(
- delegate.getClass().getName() + " failed to setup
class realm " + classRealm + ": "
- + e.getMessage(),
+ "{} failed to setup class realm {}: {}",
+ delegate.getClass().getName(),
+ classRealm,
+ e.getMessage(),
Review Comment:
⚠️ **Message duplication — `e.getMessage()` is redundant here.**
When `e` (the exception) is passed as the last argument to SLF4J
`logger.error()`, SLF4J automatically appends the exception message and stack
trace to the log output. Explicitly including `e.getMessage()` as the third
`{}` parameter means the exception message appears **twice** in the output.
Fix: drop the third placeholder and `e.getMessage()` argument:
```suggestion
"{} failed to setup class realm {}",
delegate.getClass().getName(),
classRealm,
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]