Simplified nested if-rules for model container action.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@719293 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-11-20 17:17:23 +00:00
parent d12af86b03
commit 1f5a668726
1 changed files with 4 additions and 21 deletions

View File

@ -176,35 +176,18 @@ public final class ArtifactModelContainerFactory
}
ArtifactModelContainer c = (ArtifactModelContainer) modelContainer;
if ( c.groupId.equals( groupId ) && c.artifactId.equals( artifactId ) )
if ( c.groupId.equals( groupId ) && c.artifactId.equals( artifactId ) && c.type.equals( type ) )
{
if ( c.version.equals( version ) )
{
if ( c.type.equals( type ) )
{
return ModelContainerAction.JOIN;
}
else
{
return ModelContainerAction.NOP;
}
return ModelContainerAction.JOIN;
}
else
{
if ( c.type.equals( type ) )
{
return ModelContainerAction.DELETE;
}
else
{
return ModelContainerAction.NOP;
}
return ModelContainerAction.DELETE;
}
}
else
{
return ModelContainerAction.NOP;
}
return ModelContainerAction.NOP;
}
public ModelContainer createNewInstance( List<ModelProperty> modelProperties )