Skip to content

Commit

Permalink
Switch to an assert for the bottom case
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Nov 19, 2024
1 parent bb74cf6 commit ab574b1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ private static Object innerDeepCopy(final Object value, final boolean unmodifiab
} else if (value == null || value instanceof String || value instanceof Number || value instanceof Boolean) {
return value;
} else {
throw new IllegalArgumentException("unexpected value type [" + value.getClass() + "]");
// if the previous list of expected value types ends up not being exhaustive, then we want to learn about that
// at development time, but it's probably better to err on the side of passing through the value at runtime
assert false : "unexpected value type [" + value.getClass() + "]";
return value;
}
}

Expand Down

0 comments on commit ab574b1

Please sign in to comment.