From 2ce3a6cbde640081b1a8892e57498b24f5baa1ba Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Wed, 2 Feb 2005 22:14:46 +0000 Subject: [PATCH] o Fixed formats for inheritance assembler additions o Removed unused import on defaults injector. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163331 13f79535-47bb-0310-9956-ffa450edef68 --- .../DefaultProjectDefaultsInjector.java | 1 - .../DefaultModelInheritanceAssembler.java | 35 ++++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDefaultsInjector.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDefaultsInjector.java index cfe09ab565..ce1b1edd90 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDefaultsInjector.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDefaultsInjector.java @@ -9,7 +9,6 @@ import java.util.TreeMap; import org.apache.maven.model.Dependency; import org.apache.maven.model.DependencyManagement; -import org.codehaus.plexus.util.StringUtils; /** * @author jdcasey Created on Feb 1, 2005 diff --git a/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java b/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java index ba5fa5df85..910c9afbd4 100644 --- a/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java +++ b/maven-core/src/main/java/org/apache/maven/project/inheritance/DefaultModelInheritanceAssembler.java @@ -140,14 +140,13 @@ public class DefaultModelInheritanceAssembler child.setScm( childScm ); } - if ( StringUtils.isEmpty( childScm.getConnection() ) && - !StringUtils.isEmpty( parentScm.getConnection() ) ) + if ( StringUtils.isEmpty( childScm.getConnection() ) && !StringUtils.isEmpty( parentScm.getConnection() ) ) { childScm.setConnection( parentScm.getConnection() + "/" + child.getArtifactId() ); } - if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) && - !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) ) + if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) + && !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) ) { childScm.setDeveloperConnection( parentScm.getDeveloperConnection() + "/" + child.getArtifactId() ); } @@ -326,38 +325,40 @@ public class DefaultModelInheritanceAssembler child.addPlugin( plugin ); } } - + DependencyManagement parentDepMgmt = parent.getDependencyManagement(); + DependencyManagement childDepMgmt = child.getDependencyManagement(); - if(parentDepMgmt != null) + + if ( parentDepMgmt != null ) { - if(childDepMgmt == null) + if ( childDepMgmt == null ) { - child.setDependencyManagement(parentDepMgmt); + child.setDependencyManagement( parentDepMgmt ); } else { List parentDeps = parentDepMgmt.getDependencies(); - + Map mappedParentDeps = new TreeMap(); for ( Iterator it = parentDeps.iterator(); it.hasNext(); ) { Dependency dep = (Dependency) it.next(); - mappedParentDeps.put(dep.getManagementKey(), dep); + mappedParentDeps.put( dep.getManagementKey(), dep ); } - - List deps = new ArrayList(parentDeps); + + List deps = new ArrayList( parentDeps ); for ( Iterator it = childDepMgmt.getDependencies().iterator(); it.hasNext(); ) { Dependency dep = (Dependency) it.next(); - if(!mappedParentDeps.containsKey(dep.getManagementKey())) + if ( !mappedParentDeps.containsKey( dep.getManagementKey() ) ) { - deps.add(dep); + deps.add( dep ); } } - - childDepMgmt.setDependencies(deps); + + childDepMgmt.setDependencies( deps ); } } } -} +} \ No newline at end of file