gnodet-bot commented on code in PR #13727:
URL: https://github.com/apache/maven/pull/13727#discussion_r4388814741


##########
maven-core/src/main/resources/META-INF/maven/extension.xml:
##########
@@ -127,7 +127,11 @@ under the License.
     <exportedPackage>org.slf4j.helpers.*</exportedPackage>
     <exportedPackage>org.slf4j.event.*</exportedPackage>
 
-    <!-- JAnsi -->
+    <!-- JAnsi: maven-jline ships Ansi.java, forwarding ANSI calls to the 
already-initialized JLine terminal, for
+         backward compatibility with code (e.g. maven-shared-utils) still 
calling the JAnsi API. The import falls
+         back to a plugin's own classpath for any other org.fusesource.jansi 
class the shim doesn't provide (see
+         ClassRealm#loadClassFromImport / SelfFirstStrategy), so this stays 
even though the jansi artifact itself
+         is no longer exported below. -->

Review Comment:
   💡 **Minor inaccuracy**: `SelfFirstStrategy` governs *self-before-parent* 
class lookup ordering — it's not the mechanism behind the import fallback. The 
actual fallback is that `ClassRealm#loadClassFromImport` catches 
`ClassNotFoundException` and returns `null`, which allows `loadClassFromSelf` 
to try the plugin's own classpath next. This works regardless of the strategy 
in use. Consider dropping the `SelfFirstStrategy` reference to avoid implying 
the fallback is strategy-dependent.
   
   ```suggestion
       <!-- JAnsi: maven-jline ships Ansi.java, forwarding ANSI calls to the 
already-initialized JLine terminal, for
            backward compatibility with code (e.g. maven-shared-utils) still 
calling the JAnsi API. The import falls
            back to a plugin's own classpath for any other org.fusesource.jansi 
class the shim doesn't provide (see
            ClassRealm#loadClassFromImport), so this stays even though the 
jansi artifact itself
            is no longer exported below. -->
   ```



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