diff options
author | Adam NAILI | 2018-02-04 12:44:06 +0100 |
---|---|---|
committer | Adam NAILI | 2018-02-04 12:44:06 +0100 |
commit | 444392c383ee266b0a905ed8fc9d91723ce05ef0 (patch) | |
tree | a12ba1f0b4e68eac784dd70b75075469c8c1a99e | |
parent | 1bb37ece4a139df0f120af0b42e568b2e3c88153 (diff) | |
download | wallj-444392c383ee266b0a905ed8fc9d91723ce05ef0.tar.gz |
Adding return statements in Main catches
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/viewer/Main.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/viewer/Main.java b/src/main/java/fr/umlv/java/wallj/viewer/Main.java index d133f78..d74785c 100644 --- a/src/main/java/fr/umlv/java/wallj/viewer/Main.java +++ b/src/main/java/fr/umlv/java/wallj/viewer/Main.java | |||
@@ -6,7 +6,6 @@ import fr.umlv.java.wallj.board.BoardValidator; | |||
6 | import fr.umlv.zen5.Application; | 6 | import fr.umlv.zen5.Application; |
7 | 7 | ||
8 | import java.awt.*; | 8 | import java.awt.*; |
9 | import java.io.File; | ||
10 | import java.io.IOException; | 9 | import java.io.IOException; |
11 | import java.net.URI; | 10 | import java.net.URI; |
12 | import java.net.URISyntaxException; | 11 | import java.net.URISyntaxException; |
@@ -42,7 +41,7 @@ public class Main { | |||
42 | return paths; | 41 | return paths; |
43 | } | 42 | } |
44 | 43 | ||
45 | //TODO Split Parse and validation + add useless return to satisfy this crazy compiler | 44 | //TODO Split Parse and validation + add useless return to satisfy this crazy compiler |
46 | private static Board validateBoardFromPath(Path path) { | 45 | private static Board validateBoardFromPath(Path path) { |
47 | try { | 46 | try { |
48 | BoardValidator boardValidator = new BoardValidator(BoardParser.parse(path)); | 47 | BoardValidator boardValidator = new BoardValidator(BoardParser.parse(path)); |
@@ -54,12 +53,14 @@ public class Main { | |||
54 | } catch (IOException e) { | 53 | } catch (IOException e) { |
55 | System.err.println(e.getMessage()); | 54 | System.err.println(e.getMessage()); |
56 | System.exit(2); | 55 | System.exit(2); |
56 | return null; | ||
57 | } catch (BoardValidator.ValidationException e) { | 57 | } catch (BoardValidator.ValidationException e) { |
58 | System.err.println(path.toString() + ':'); | 58 | System.err.println(path.toString() + ':'); |
59 | for (Throwable throwable : e.getSuppressed()) { | 59 | for (Throwable throwable : e.getSuppressed()) { |
60 | System.err.println(throwable.getMessage()); | 60 | System.err.println(throwable.getMessage()); |
61 | } | 61 | } |
62 | System.exit(3); | 62 | System.exit(3); |
63 | return null; | ||
63 | } | 64 | } |
64 | } | 65 | } |
65 | 66 | ||