fix of version's comparing.(I don't know why it was wrong but...)

This commit is contained in:
xsun2001 2017-08-13 21:23:28 +08:00
parent 63880be5d8
commit 107fc55165
1 changed files with 8 additions and 9 deletions

View File

@ -42,16 +42,15 @@ public final class DefaultVersion extends BaseVersion
@Override
public boolean isNewerAs( final Version maybeOlder )
{
if( this.revision() < maybeOlder.revision() )
if( this.revision() == maybeOlder.revision() )
{
return false;
if( this.channel().compareTo( maybeOlder.channel() ) == 0 )
{
return this.build() > maybeOlder.build();
}
return this.channel().compareTo( maybeOlder.channel() ) > 0;
}
if( this.channel().compareTo( maybeOlder.channel() ) < 0 )
{
return false;
}
return this.build() > maybeOlder.build();
else
return this.revision() > maybeOlder.revision();
}
}