Skip to content

Commit

Permalink
[MPH-183] Remove indentation for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovds committed Mar 15, 2024
1 parent 3cd4d9d commit b50cda2
Showing 1 changed file with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ private void importDependencyManagement(
importIds.add(importing);

// Model v4
List<org.apache.maven.api.model.DependencyManagement> importMgmts = null;
List<org.apache.maven.api.model.DependencyManagement> importMgmts = new ArrayList<>();

for (Iterator<Dependency> it = depMgmt.getDependencies().iterator(); it.hasNext(); ) {
Dependency dependency = it.next();
Expand All @@ -1686,22 +1686,19 @@ private void importDependencyManagement(

// Model v3
DependencyManagement importMgmt = loadDependencyManagement(model, request, problems, dependency, importIds);
if (importMgmt == null) {
continue;
}

if (importMgmt != null) {
if (importMgmts == null) {
importMgmts = new ArrayList<>();
}

if (request.isLocationTracking()) {
// Keep track of why this DependencyManagement was imported.
// And map model v3 to model v4 -> importMgmt(v3).getDelegate() returns a v4 object
importMgmts.add(
org.apache.maven.api.model.DependencyManagement.newBuilder(importMgmt.getDelegate(), true)
.importedFrom(dependency.getDelegate().getLocation(""))
.build());
} else {
importMgmts.add(importMgmt.getDelegate());
}
if (request.isLocationTracking()) {
// Keep track of why this DependencyManagement was imported.
// And map model v3 to model v4 -> importMgmt(v3).getDelegate() returns a v4 object
importMgmts.add(
org.apache.maven.api.model.DependencyManagement.newBuilder(importMgmt.getDelegate(), true)
.importedFrom(dependency.getDelegate().getLocation(""))
.build());
} else {
importMgmts.add(importMgmt.getDelegate());
}
}

Expand Down

0 comments on commit b50cda2

Please sign in to comment.