rmannibucau commented on code in PR #913:
URL: https://github.com/apache/maven/pull/913#discussion_r1081012109


##########
maven-core/src/main/java/org/apache/maven/internal/aether/MavenChainedWorkspaceReader.java:
##########
@@ -60,6 +62,31 @@ public Model findModel(Artifact artifact) {
         return null;
     }
 
+    @Override
+    public Stream<Artifact> listArtifacts() {
+        return Arrays.stream(readers)
+                .flatMap(r -> {
+                    // TODO once resolver 2.x is there this part can be 
simplified
+                    if (r instanceof MavenWorkspaceReader) {
+                        return ((MavenWorkspaceReader) r).listArtifacts();
+                    }
+                    return Stream.empty();

Review Comment:
   maybe use `filter(it -> instanceof 
MavenWorkspaceReader).map(MavenWorkspaceReader.class::cast)`, will avoid the 
debate of `if/else` (readability on the left vs symmetry - no good choice there)



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