elharo commented on code in PR #3453:
URL: https://github.com/apache/maven-surefire/pull/3453#discussion_r3914339424


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java:
##########
@@ -868,7 +873,7 @@ private static List<String> readTestClassNames(File 
discoveryFile) throws Surefi
         try {
             return Files.readAllLines(discoveryFile.toPath(), UTF_8).stream()
                     .map(String::trim)
-                    .filter(String::isEmpty)
+                    .filter(line -> !line.isEmpty())

Review Comment:
   This is exactly the problem with lambdas and filters. It is completely 
opaque whether you're filtering values in or out. Even if this code is now 
correct, it would be much clearer to rewrite the operation using a simple, 
ordinary loop that leaves no room for doubt about what it's doing. 



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