[MNG-6944] Fix ordering lifecycles

This commit is contained in:
rfscholte 2020-06-23 19:37:29 +02:00
parent bdec668de9
commit a945ca4ed3
1 changed files with 7 additions and 4 deletions

View File

@ -124,13 +124,16 @@ public class DefaultLifecycles
Comparator<String> comparator = ( l, r ) ->
{
if ( lifecycleIds.contains( l ) )
int lx = lifecycleIds.indexOf( l );
int rx = lifecycleIds.indexOf( r );
if ( lx < 0 || rx < 0 )
{
return lifecycleIds.indexOf( l ) - lifecycleIds.indexOf( r );
return rx - lx;
}
else
else
{
return Integer.MAX_VALUE;
return lx - rx;
}
};