Arrays.sort( infos, new InfoComparator() );
for ( Info info : infos )
{
DiffMessage diffMessage = null;
Version newerVersion = info.newerVersion;
Version suggestedVersion = info.suggestedVersion;
if ( suggestedVersion != null )
{
if ( newerVersion.compareTo( suggestedVersion ) > 0 )
{
diffMessage = new DiffMessage( "Excessive version increase", DiffMessage.Type.warning );
reporter.warning( "%s: %s; detected %s, suggested %s",
info.packageName, diffMessage, info.newerVersion, info.suggestedVersion );
}
else if ( newerVersion.compareTo( suggestedVersion ) < 0 )
{
diffMessage = new DiffMessage( "Version increase required", DiffMessage.Type.error );
reporter.error( "%s: %s; detected %s, suggested %s",
info.packageName, diffMessage, info.newerVersion, info.suggestedVersion );
}
}
Diff packageDiff = info.packageDiff;
Delta delta = packageDiff.getDelta();
switch ( delta )
{
case UNCHANGED:
if ( ( suggestedVersion.getMajor() != newerVersion.getMajor() )
|| ( suggestedVersion.getMicro() != newerVersion.getMicro() )
|| ( suggestedVersion.getMinor() != newerVersion.getMinor() ) )
{
diffMessage = new DiffMessage( "Version has been increased but analysis detected no changes", DiffMessage.Type.warning );
reporter.warning( "%s: %s; detected %s, suggested %s",
info.packageName, diffMessage, info.newerVersion, info.suggestedVersion );
}