jjkester commented on code in PR #1821:
URL: https://github.com/apache/maven/pull/1821#discussion_r1807256540


##########
maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java:
##########
@@ -564,20 +564,21 @@ public void mergeRepositories(List<Repository> toAdd, 
boolean replace) {
         // Infer inner reactor dependencies version
         //
         Model transformFileToRaw(Model model) {
-            List<Dependency> newDeps = new ArrayList<>();
-            boolean modified = false;
+            if (model.getDependencies().isEmpty()) {
+                return model;
+            }
+            List<Dependency> newDeps = new 
ArrayList<>(model.getDependencies().size());
             for (Dependency dep : model.getDependencies()) {
                 if (dep.getVersion() == null) {
-                    Dependency.Builder depBuilder = null;
                     Model depModel = getRawModel(model.getPomFile(), 
dep.getGroupId(), dep.getArtifactId());

Review Comment:
   @gnodet I think this part of the code (starting here or below `if (depModel 
!= null)`) is a good candidate for extraction to improve readability. It seems 
to just apply the new logic to retrieve the version from the aggregated build. 
However, I do not have a clear name for that method since I'm not familiar with 
the common terminology. Do you have a suggestion?



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