Skip to content

Commit efe5fec

Browse files
committed
Add exception if state reason is not a legal value
instead of assigning completed as default case, now throw an error. If new state reasons are added later on githubs side, the occurence of this error should prevent us from not noticing that change. Signed-off-by: Leo Sendelbach <[email protected]>
1 parent 1b6f8d5 commit efe5fec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/de/uni_passau/fim/gitwrapper/StateReason.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public static StateReason getFromString(String string) {
6363
case "duplicate":
6464
return DUPLICATE;
6565
default:
66-
return COMPLETED;
66+
throw new IllegalArgumentException("Found state reason (" + string + ") that was neither 'completed'," +
67+
"'reopened', 'not_planned'. nor 'duplicate'!");
6768
}
6869
}
6970
}

0 commit comments

Comments
 (0)