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;
|
ReleaseArtifactMetadata metadata = (ReleaseArtifactMetadata) o;
|
||||||
|
|
||||||
|
// TODO: we need some more complicated version comparison
|
||||||
if ( version == null )
|
if ( version == null )
|
||||||
{
|
{
|
||||||
if ( metadata.version == null )
|
if ( metadata.version == null )
|
||||||
|
@ -58,9 +59,17 @@ public class ReleaseArtifactMetadata
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// TODO: we need some more complicated version comparison
|
{
|
||||||
return version.compareTo( metadata.version );
|
if ( metadata.version == null )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return version.compareTo( metadata.version );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean newerThanFile( File file )
|
public boolean newerThanFile( File file )
|
||||||
|
|
Loading…
Reference in New Issue