diff options
Diffstat (limited to 'src/main')
6 files changed, 16 insertions, 20 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/controllers/LobbyController.java b/src/main/java/org/luxons/sevenwonders/controllers/LobbyController.java index 22e994dd..04735040 100644 --- a/src/main/java/org/luxons/sevenwonders/controllers/LobbyController.java +++ b/src/main/java/org/luxons/sevenwonders/controllers/LobbyController.java @@ -110,13 +110,13 @@ public class LobbyController { return lobby; } - private class UserOwnsNoLobbyException extends ApiMisuseException { + private static class UserOwnsNoLobbyException extends ApiMisuseException { UserOwnsNoLobbyException(String message) { super(message); } } - private class UserAlreadyInGameException extends ApiMisuseException { + private static class UserAlreadyInGameException extends ApiMisuseException { UserAlreadyInGameException(String gameName, String impossibleActionDescription) { super("Client already in game '" + gameName + "', " + impossibleActionDescription); } diff --git a/src/main/java/org/luxons/sevenwonders/errors/UserInputException.java b/src/main/java/org/luxons/sevenwonders/errors/UserInputException.java index a86448ae..4033a696 100644 --- a/src/main/java/org/luxons/sevenwonders/errors/UserInputException.java +++ b/src/main/java/org/luxons/sevenwonders/errors/UserInputException.java @@ -11,11 +11,11 @@ public class UserInputException extends RuntimeException { this.params = params; } - public String getMessageResourceKey() { + String getMessageResourceKey() { return messageResourceKey; } - public Object[] getParams() { + Object[] getParams() { return params; } } diff --git a/src/main/java/org/luxons/sevenwonders/game/Game.java b/src/main/java/org/luxons/sevenwonders/game/Game.java index 6006ef47..70a5b615 100644 --- a/src/main/java/org/luxons/sevenwonders/game/Game.java +++ b/src/main/java/org/luxons/sevenwonders/game/Game.java @@ -131,8 +131,7 @@ public class Game { } private static class MissingPreparedMoveException extends RuntimeException { - - public MissingPreparedMoveException(int playerIndex) { + MissingPreparedMoveException(int playerIndex) { super("Player " + playerIndex + " is not ready to play"); } } diff --git a/src/main/java/org/luxons/sevenwonders/game/Lobby.java b/src/main/java/org/luxons/sevenwonders/game/Lobby.java index 16d4e8a3..241c5530 100644 --- a/src/main/java/org/luxons/sevenwonders/game/Lobby.java +++ b/src/main/java/org/luxons/sevenwonders/game/Lobby.java @@ -86,18 +86,17 @@ public class Lobby { return owner.getUserName().equals(userName); } - public class GameAlreadyStartedException extends IllegalStateException { + private static class GameAlreadyStartedException extends IllegalStateException { } - public class PlayerOverflowException extends IllegalStateException { + private static class PlayerOverflowException extends IllegalStateException { } - public class PlayerUnderflowException extends IllegalStateException { + private static class PlayerUnderflowException extends IllegalStateException { } - public class PlayerNameAlreadyUsedException extends UniqueIdAlreadyUsedException { - - public PlayerNameAlreadyUsedException(String name) { + private static class PlayerNameAlreadyUsedException extends UniqueIdAlreadyUsedException { + PlayerNameAlreadyUsedException(String name) { super(name); } } diff --git a/src/main/java/org/luxons/sevenwonders/repositories/GameRepository.java b/src/main/java/org/luxons/sevenwonders/repositories/GameRepository.java index 14aaf3ac..0e0f6db8 100644 --- a/src/main/java/org/luxons/sevenwonders/repositories/GameRepository.java +++ b/src/main/java/org/luxons/sevenwonders/repositories/GameRepository.java @@ -27,13 +27,13 @@ public class GameRepository { return game; } - private class GameNotFoundException extends ApiMisuseException { + private static class GameNotFoundException extends ApiMisuseException { GameNotFoundException(long id) { super("Game " + id + " doesn't exist"); } } - private class GameAlreadyExistsException extends ApiMisuseException { + private static class GameAlreadyExistsException extends ApiMisuseException { GameAlreadyExistsException(long id) { super("Game " + id + " already exists"); } diff --git a/src/main/java/org/luxons/sevenwonders/repositories/LobbyRepository.java b/src/main/java/org/luxons/sevenwonders/repositories/LobbyRepository.java index e4f049f5..2a4db2f3 100644 --- a/src/main/java/org/luxons/sevenwonders/repositories/LobbyRepository.java +++ b/src/main/java/org/luxons/sevenwonders/repositories/LobbyRepository.java @@ -42,16 +42,14 @@ public class LobbyRepository { return lobby; } - private class LobbyNotFoundException extends RuntimeException { - - public LobbyNotFoundException(String name) { + private static class LobbyNotFoundException extends RuntimeException { + LobbyNotFoundException(String name) { super("Lobby not found for game '" + name + "'"); } } - private class GameNameAlreadyUsedException extends UserInputException { - - public GameNameAlreadyUsedException(String name) { + private static class GameNameAlreadyUsedException extends UserInputException { + GameNameAlreadyUsedException(String name) { super("Game name '" + name + "' already exists"); } } |