We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5c0ed67 + 1615e52 commit f05a337Copy full SHA for f05a337
patterns-modules/data-oriented-programming/src/main/java/com/baeldung/patterns/data/Roll.java
@@ -9,7 +9,6 @@ public record Roll(List<Integer> dice, int rollCount) {
9
throw new IllegalArgumentException("A Roll needs to have exactly 5 dice.");
10
if (dice.stream().anyMatch(die -> die < 1 || die > 6))
11
throw new IllegalArgumentException("Dice values should be between 1 and 6.");
12
-
13
- dice = Collections.unmodifiableList(dice);
+ dice = List.copyOf(dice);
14
}
15
0 commit comments