Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-8331] Mix of the two fixes #1823

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,10 @@ 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;
Expand All @@ -591,13 +593,14 @@ Model transformFileToRaw(Model model) {
}
if (depBuilder != null) {
newDeps.add(depBuilder.build());
modified = true;
} else {
newDeps.add(dep);
}
} else {
newDeps.add(dep);
}
}
return modified ? model.withDependencies(newDeps) : model;
return model.withDependencies(newDeps);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model.withDependencies() will always create a new object if not modified.
I don't see why this would be needed.

}

String replaceCiFriendlyVersion(Map<String, String> properties, String version) {
Expand Down