maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Tran (JIRA)" <j...@codehaus.org>
Subject [jira] Reopened: (MDEP-193) NullPointerException inside org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
Date Fri, 01 Jan 2010 08:35:55 GMT

     [ http://jira.codehaus.org/browse/MDEP-193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dan Tran reopened MDEP-193:
---------------------------


> NullPointerException inside org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: MDEP-193
>                 URL: http://jira.codehaus.org/browse/MDEP-193
>             Project: Maven 2.x Dependency Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Sascha Hofer
>            Assignee: Dan Tran
>             Fix For: 2.2
>
>
> when using the profile shown below AbstractArtifactFeatureFilter (concrete class: org.apache.maven.shared.artifact.filter.collection.ClassifierFilter)
encounters a NullPointerException when comparing an artifacts classifier with one of the exclusion
list.
> This NPE happens because there are artifacts which simple have no classifier and AbstractArtifactFeatureFilter.compareFeatures(String,
String) simply invokes <left string>.equals(<right string>).
> In addition to this the stated NPE must already have been occured some time ago because
in org.apache.maven.shared.artifact.filter.collection.FilterArtifacts.filter(Set) it gets
catched and ignored.
> proposed fix in org.apache.maven.shared.artifact.filter.collection.AbstractArtifactFeatureFilter:
>     /**
>      * Allows Feature comparison to be customized
>      * 
>      * @param lhs String artifact's feature
>      * @param rhs String feature from exclude or include list
>      * @return boolean true if features match
>      */
>     protected boolean compareFeatures( String lhs, String rhs )
>     {
>         if (lhs == null)
>         {
>             return rhs == null;
>         }
>         else
>         {
>             return ( lhs.equals( rhs ) );
>         }
>     }
> part of the pom.xml which caused the error:
>         <profile>
>             <id>multi-module-coverage</id>
>         	<build>
>         		<plugins>
>         			<plugin>
>                         <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-dependency-plugin</artifactId>
>                         <executions>
>                           <execution>
>                             <id>unpack-dependencies</id>
>                             <phase>process-classes</phase>
>                             <goals>
>                               <goal>unpack-dependencies</goal>
>                             </goals>
>                             <configuration>
>                                 <outputDirectory>${project.build.directory}/classes</outputDirectory>
>                                 <excludeClassifiers>tests</excludeClassifiers>
>                             </configuration>
>                           </execution>
>                         </executions>
>         			</plugin>
>         		</plugins>
>         	</build>
>         </profile>

-- 
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

        

Mime
View raw message