[Fix] Created/Closed combination is also possible

This commit is contained in:
Robert von Burg 2017-06-19 10:08:45 +02:00
parent f73b8e2455
commit 5ac798f42c
1 changed files with 3 additions and 0 deletions

View File

@ -225,6 +225,9 @@ public enum State {
if (states.contains(State.PLANNED) && (states.contains(State.CLOSED)))
return State.PLANNED;
if (states.contains(State.CREATED) && (states.contains(State.CLOSED)))
return State.CREATED;
// should never happen, unless new state is introduced
throw new IllegalStateException("Unhandled situation with states: "
+ states.stream().map(e -> e.state).collect(Collectors.joining(", ")));