Author: bentmann
Date: Sat Mar 21 12:14:15 2009
New Revision: 756924
URL: http://svn.apache.org/viewvc?rev=756924&view=rev
Log:
o Formatted code
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java
Modified:
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java
URL:
http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java?rev=756924&r1=756923&r2=756924&view=diff
==============================================================================
---
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java
(original)
+++
maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java
Sat Mar 21 12:14:15 2009
@@ -23,48 +23,52 @@
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.Model;
import org.apache.maven.model.Relocation;
-import org.apache.maven.model.Repository;
import org.apache.maven.model.Site;
-public class DistributionManagementProcessor extends BaseProcessor
+public class DistributionManagementProcessor
+ extends BaseProcessor
{
+
public void process( Object parent, Object child, Object target, boolean
isChildMostSpecialized )
{
super.process( parent, child, target, isChildMostSpecialized );
+
Model t = (Model) target;
Model c = (Model) child;
Model p = (Model) parent;
-
- if(t.getDependencyManagement() == null &&
- (p != null && p.getDistributionManagement() != null ||
c.getDistributionManagement() != null) )
+
+ if ( t.getDependencyManagement() == null
+ && ( p != null && p.getDistributionManagement() != null ||
c.getDistributionManagement() != null ) )
{
t.setDistributionManagement( new DistributionManagement() );
}
-
- if(c.getDistributionManagement() != null)
+
+ if ( c.getDistributionManagement() != null )
{
- copy(c.getDistributionManagement(), t.getDistributionManagement(),
isChildMostSpecialized, c.getArtifactId());
- if(p != null && p.getDistributionManagement() != null)
+ copy( c.getDistributionManagement(),
t.getDistributionManagement(), isChildMostSpecialized,
+ c.getArtifactId() );
+ if ( p != null && p.getDistributionManagement() != null )
{
- copy(p.getDistributionManagement(),
t.getDistributionManagement(), false, c.getArtifactId());
- }
+ copy( p.getDistributionManagement(),
t.getDistributionManagement(), false, c.getArtifactId() );
+ }
}
- else if(p != null && p.getDistributionManagement() != null)
+ else if ( p != null && p.getDistributionManagement() != null )
{
- copy(p.getDistributionManagement(), t.getDistributionManagement(),
false, c.getArtifactId());
+ copy( p.getDistributionManagement(),
t.getDistributionManagement(), false, c.getArtifactId() );
}
}
-
- private static void copy(DistributionManagement source,
DistributionManagement target, boolean isChild, String artifactId)
+
+ private static void copy( DistributionManagement source,
DistributionManagement target, boolean isChild,
+ String artifactId )
{
- if(target.getDownloadUrl() == null)
+ if ( target.getDownloadUrl() == null )
{
target.setDownloadUrl( source.getDownloadUrl() );
}
-
- if(target.getRelocation() == null && isChild && source.getRelocation()
!= null)
+
+ if ( target.getRelocation() == null && isChild &&
source.getRelocation() != null )
{
- Relocation sourceRelocation = source.getRelocation();
+ Relocation sourceRelocation = source.getRelocation();
Relocation r = new Relocation();
r.setArtifactId( sourceRelocation.getArtifactId() );
r.setGroupId( sourceRelocation.getGroupId() );
@@ -72,67 +76,64 @@
r.setVersion( sourceRelocation.getVersion() );
target.setRelocation( r );
}
-
- if(target.getStatus() == null)
+
+ if ( target.getStatus() == null )
{
target.setStatus( source.getStatus() );
}
-
- if(target.getRepository() == null && source.getRepository() != null)
+
+ if ( target.getRepository() == null && source.getRepository() != null )
{
target.setRepository( new DeploymentRepository() );
- copyRepository(source.getRepository(), target.getRepository());
+ copyRepository( source.getRepository(), target.getRepository() );
}
- if(target.getSnapshotRepository() == null &&
source.getSnapshotRepository() != null)
+ if ( target.getSnapshotRepository() == null &&
source.getSnapshotRepository() != null )
{
target.setSnapshotRepository( new DeploymentRepository() );
- copyRepository(source.getSnapshotRepository(),
target.getSnapshotRepository());
- }
-
- if(target.getSite() == null && source.getSite() != null)
+ copyRepository( source.getSnapshotRepository(),
target.getSnapshotRepository() );
+ }
+
+ if ( target.getSite() == null && source.getSite() != null )
{
target.setSite( new Site() );
- copySite(source.getSite(), target.getSite(), isChild, artifactId);
+ copySite( source.getSite(), target.getSite(), isChild, artifactId
);
}
}
-
- private static void copyRepository(DeploymentRepository source,
DeploymentRepository target)
+
+ private static void copyRepository( DeploymentRepository source,
DeploymentRepository target )
{
- if(target.getId() == null)
+ if ( target.getId() == null )
{
target.setId( source.getId() );
}
-
- if(target.getLayout() == null){
+
+ if ( target.getLayout() == null )
+ {
target.setLayout( source.getLayout() );
}
-
- if(target.getName() == null)
+
+ if ( target.getName() == null )
{
target.setUrl( source.getUrl() );
}
}
-
- private static void copySite(Site source, Site target, boolean isChild,
String artifactId)
+
+ private static void copySite( Site source, Site target, boolean isChild,
String artifactId )
{
- if(target.getId() == null)
+ if ( target.getId() == null )
{
target.setId( source.getId() );
}
- /*
- if(target.getModelEncoding() == null)
- {
- target.setModelEncoding( source.getModelEncoding() );
- }
- */
- if(target.getName() == null)
+
+ if ( target.getName() == null )
{
target.setName( source.getName() );
}
-
- if(target.getUrl() == null)
+
+ if ( target.getUrl() == null )
{
- target.setUrl( source.getUrl() +"/" + artifactId );
+ target.setUrl( source.getUrl() + "/" + artifactId );
}
}
+
}