slawekjaranowski commented on code in PR #1944:
URL: https://github.com/apache/maven/pull/1944#discussion_r1865019649


##########
impl/maven-core/src/main/java/org/apache/maven/graph/FilteredProjectDependencyGraph.java:
##########
@@ -74,12 +79,24 @@ public List<MavenProject> getSortedProjects() {
 
     @Override
     public List<MavenProject> getDownstreamProjects(MavenProject project, 
boolean transitive) {
-        return 
applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), 
transitive, false);
+        Key key = new Key(project, transitive, false);
+        List<MavenProject> list = cache.get(key);
+        if (list == null) {
+            list = 
applyFilter(projectDependencyGraph.getDownstreamProjects(project, transitive), 
transitive, false);
+            cache.put(key, list);
+        }

Review Comment:
   comments here why not use  `computeIfAbsenta` - can help in future



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