ProjectTransitivityFilter has incorrect behavior for 
artifactIsADirectDependency method
---------------------------------------------------------------------------------------

                 Key: MSHARED-88
                 URL: http://jira.codehaus.org/browse/MSHARED-88
             Project: Maven Shared Components
          Issue Type: Bug
          Components: maven-common-artifact-filters
            Reporter: Owen Kellett
            Priority: Minor


In the class 
org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter, 
the filter should only include items that are part of the direct dependencies.  
However, the method that does this check (artifactIsADirectDependency) only 
verifies that a dependency has the same artifactId and groupId as a direct 
dependency.  It should also check the classifier and type.  I've included an 
updated version of the method below:


{code:java}
public boolean artifactIsADirectDependency( Artifact artifact )
{
    boolean result = false;
    Iterator iterator = this.directDependencies.iterator();
    while ( iterator.hasNext() )
    {
        Artifact dependency = (Artifact) iterator.next();
        if ( dependency.getGroupId().equals( artifact.getGroupId() ) &&
            dependency.getArtifactId().equals( artifact.getArtifactId() ) &&
            dependency.getClassifier().equals( artifact.getClassifier() ) &&
            dependency.getType().equals( artifact.getType() ) )
        {
            result = true;
            break;
        }
    }
    return result;
}
{code}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to