mirror of https://github.com/apache/maven.git
fix bug in compareTo when metadata.version is null
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@169306 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
05affa0a65
commit
637c0f815b
|
@ -47,6 +47,7 @@ public class ReleaseArtifactMetadata
|
|||
{
|
||||
ReleaseArtifactMetadata metadata = (ReleaseArtifactMetadata) o;
|
||||
|
||||
// TODO: we need some more complicated version comparison
|
||||
if ( version == null )
|
||||
{
|
||||
if ( metadata.version == null )
|
||||
|
@ -58,9 +59,17 @@ public class ReleaseArtifactMetadata
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: we need some more complicated version comparison
|
||||
return version.compareTo( metadata.version );
|
||||
else
|
||||
{
|
||||
if ( metadata.version == null )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return version.compareTo( metadata.version );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean newerThanFile( File file )
|
||||
|
|
Loading…
Reference in New Issue