From eba93d55e1011756ea7ce3f8d8fb8c4724ee847b Mon Sep 17 00:00:00 2001 From: asvitkine Date: Sun, 22 May 2022 21:26:09 -0400 Subject: [PATCH] Remove an unused method only referenced by tests. (#10492) * Remove an unused method only referenced by tests. * Remove imports. --- .../main/java/games/strategy/engine/history/History.java | 9 --------- .../strategy/engine/data/gameparser/GameParserTest.java | 1 - .../strategy/engine/data/GameSaveCompatibilityTest.java | 1 - 3 files changed, 11 deletions(-) diff --git a/game-app/game-core/src/main/java/games/strategy/engine/history/History.java b/game-app/game-core/src/main/java/games/strategy/engine/history/History.java index 70e8cbc73c2..9958a9a2d71 100644 --- a/game-app/game-core/src/main/java/games/strategy/engine/history/History.java +++ b/game-app/game-core/src/main/java/games/strategy/engine/history/History.java @@ -4,13 +4,11 @@ import games.strategy.engine.data.Change; import games.strategy.engine.data.CompositeChange; import games.strategy.engine.data.GameData; -import games.strategy.engine.data.GamePlayer; import games.strategy.triplea.ui.history.HistoryPanel; import games.strategy.ui.Util; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; -import java.util.Optional; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; @@ -61,13 +59,6 @@ public void goToEnd() { } } - public Optional getActivePlayer() { - if (currentNode instanceof Step) { - return GamePlayer.asOptional(((Step) currentNode).getPlayerId()); - } - return Optional.empty(); - } - public HistoryNode getLastNode() { assertCorrectThread(); return getLastChildInternal((HistoryNode) getRoot()); diff --git a/game-app/game-core/src/test/java/games/strategy/engine/data/gameparser/GameParserTest.java b/game-app/game-core/src/test/java/games/strategy/engine/data/gameparser/GameParserTest.java index 3f8d5291233..657abcc672d 100644 --- a/game-app/game-core/src/test/java/games/strategy/engine/data/gameparser/GameParserTest.java +++ b/game-app/game-core/src/test/java/games/strategy/engine/data/gameparser/GameParserTest.java @@ -43,7 +43,6 @@ private void assertNotNullGameData(final GameData gameData) { assertThat(gameData.getDiceSides(), is(notNullValue())); assertThat(gameData.getGameLoader(), is(notNullValue())); assertThat(gameData.getGameName(), is(notNullValue())); - assertThat(gameData.getHistory().getActivePlayer(), is(notNullValue())); assertThat(gameData.getHistory().getLastNode(), is(notNullValue())); assertThat(gameData.getMap().getTerritories(), is(notNullValue())); assertThat(gameData.getPlayerList().getPlayers(), is(notNullValue())); diff --git a/smoke-testing/src/test/java/games/strategy/engine/data/GameSaveCompatibilityTest.java b/smoke-testing/src/test/java/games/strategy/engine/data/GameSaveCompatibilityTest.java index d49ad35e737..59c46934abd 100644 --- a/smoke-testing/src/test/java/games/strategy/engine/data/GameSaveCompatibilityTest.java +++ b/smoke-testing/src/test/java/games/strategy/engine/data/GameSaveCompatibilityTest.java @@ -34,7 +34,6 @@ void loadSaveGames(final Path saveGame) throws Exception { assertThat(gameData.getDiceSides(), is(notNullValue())); assertThat(gameData.getGameLoader(), is(notNullValue())); assertThat(gameData.getGameName(), is(notNullValue())); - assertThat(gameData.getHistory().getActivePlayer(), is(notNullValue())); assertThat(gameData.getHistory().getLastNode(), is(notNullValue())); assertThat(gameData.getMap().getTerritories(), is(notNullValue())); assertThat(gameData.getPlayerList().getPlayers(), is(notNullValue()));