summaryrefslogtreecommitdiff
path: root/src/main/java/org
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-19 19:01:22 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-19 19:14:03 +0100
commit83241be83fafc52ee6088b77306355eeaebe854f (patch)
treefe839a21dad0af29f2b13acfd78cf2eb46b70f9d /src/main/java/org
parentFix logger class in ExceptionHandler (diff)
downloadseven-wonders-83241be83fafc52ee6088b77306355eeaebe854f.tar.gz
seven-wonders-83241be83fafc52ee6088b77306355eeaebe854f.tar.bz2
seven-wonders-83241be83fafc52ee6088b77306355eeaebe854f.zip
Adjust exceptions visibility
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/luxons/sevenwonders/controllers/LobbyController.java4
-rw-r--r--src/main/java/org/luxons/sevenwonders/errors/UserInputException.java4
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/Game.java3
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/Lobby.java11
-rw-r--r--src/main/java/org/luxons/sevenwonders/repositories/GameRepository.java4
-rw-r--r--src/main/java/org/luxons/sevenwonders/repositories/LobbyRepository.java10
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");
}
}
bgstack15