grobmeier commented on code in PR #14177:
URL: https://github.com/apache/maven/pull/14177#discussion_r4737451108


##########
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:
   @gnodet I checked both findings against the current PR head and disagree 
with @gnodet-bot 
   Which revision is the bot using? It seemes it runs against an older version 
of LookupInvoker
   
   `LookupInvoker`: `context.logger` uses `org.apache.maven.api.logging.Logger` 
which defines `atDebug()`. The Javadoc shows {}, but the implementation and its 
test use numbered placeholders such as {0}. The CI build also passed with these 
calls in place. [Logger 
import](https://github.com/apache/maven/blob/3629e2de448cae82c71d70715dfec176f086d4c5/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupContext.java#L35)
 · [atDebug() 
declaration](https://github.com/apache/maven/blob/3629e2de448cae82c71d70715dfec176f086d4c5/api/maven-api-log/src/main/java/org/apache/maven/api/logging/Logger.java#L119)
 · [Formatter 
test](https://github.com/apache/maven/blob/3629e2de448cae82c71d70715dfec176f086d4c5/impl/maven-logging/src/test/java/org/apache/maven/logging/impl/DefaultLoggerTest.java#L156-L170)
 · [CI 
job](https://github.com/apache/maven/actions/runs/46388013586/job/141743124110)
   
   `DefaultClassRealmManager`: The original call already included 
`e.getMessage()` in the log message and passed e separately. The parameterised 
call preserves both. Removing `e.getMessage()` would change the warning text, 
so I’d keep it as part of this refactor. 
[Before](https://github.com/apache/maven/blob/edd58872f927fd7c4c642021a70dc8359bdc9cf5/impl/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L308-L311)
 · 
[After](https://github.com/apache/maven/blob/3629e2de448cae82c71d70715dfec176f086d4c5/impl/maven-core/src/main/java/org/apache/maven/classrealm/DefaultClassRealmManager.java#L308-L313)
   
   



-- 
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]

Reply via email to