From b91369a41a605c5b941479c43aa6fc1221e78067 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sat, 9 Apr 2016 23:25:33 +0200 Subject: Fix mutable lists encapsulation failure --- src/ch/epfl/xblast/server/GameState.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ch/epfl/xblast/server/GameState.java b/src/ch/epfl/xblast/server/GameState.java index 6ff0ded..8a9d5a9 100644 --- a/src/ch/epfl/xblast/server/GameState.java +++ b/src/ch/epfl/xblast/server/GameState.java @@ -395,11 +395,11 @@ public final class GameState { this.board = Objects.requireNonNull(board); if (players.size() != PlayerID.values().length) throw new IllegalArgumentException(); - this.players = players; + this.players = new ArrayList<>(players); - this.bombs = Objects.requireNonNull(bombs); - this.explosions = Objects.requireNonNull(explosions); - this.blasts = Objects.requireNonNull(blasts); + this.bombs = new ArrayList<>(Objects.requireNonNull(bombs)); + this.explosions = new ArrayList<>(Objects.requireNonNull(explosions)); + this.blasts = new ArrayList<>(Objects.requireNonNull(blasts)); } /** -- cgit v1.2.3