Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
#28: fix a bug moving a processor to an empty trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Mar 2, 2016
1 parent b78ed2e commit 9152a76
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -16,6 +16,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
Expand Down Expand Up @@ -227,10 +228,19 @@ public void moveProcessor ( final String triggerId1, final String processorId1,
throw new IllegalArgumentException ( String.format ( "Unknow trigger '%s'", triggerId1 ) );
}

final List<TriggerProcessorConfiguration> list2 = this.processors.get ( triggerId2 );
List<TriggerProcessorConfiguration> list2 = this.processors.get ( triggerId2 );
if ( list2 == null )
{
throw new IllegalArgumentException ( String.format ( "Unknow trigger '%s'", triggerId2 ) );
if ( processorId2 != null )
{
throw new IllegalArgumentException ( String.format ( "Unknow trigger '%s'", triggerId2 ) );
}
else
{
// we don't expect anything to be in this list, so it might be that it is not filled
list2 = new LinkedList<> ();
this.processors.put ( triggerId2, list2 );
}
}

final int p1 = indexOf ( list1, e -> e.getId ().equals ( processorId1 ) );
Expand Down

0 comments on commit 9152a76

Please sign in to comment.