cstamas commented on code in PR #2254:
URL: https://github.com/apache/maven/pull/2254#discussion_r2041185624


##########
impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/cisupport/CIDetectorHelper.java:
##########
@@ -33,15 +33,13 @@ public final class CIDetectorHelper {
     private CIDetectorHelper() {}
 
     public static List<CIInfo> detectCI() {
-        List<CIDetector> detectors = 
ServiceLoader.load(CIDetector.class).stream()
+        List<CIInfo> result = new 
ArrayList<>(ServiceLoader.load(CIDetector.class).stream()
                 .map(ServiceLoader.Provider::get)
-                .toList();
+                .map(CIDetector::detectCI)
+                .filter(Optional::isPresent)
+                .map(Optional::get)
+                .toList());

Review Comment:
   I think is fine, this happens "on boot", is not some sort of "hot" spot. The 
reason why I remove "generic" if there are 2 or more is that I assume there is 
more specific hit (like GH, sets `CI=true` but also sets 
`GITHUB_RUNNER=true`)... we can refine this later anyway.



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to