diff --git a/src/edu/kit/informatik/model/FreightCoach.java b/src/edu/kit/informatik/model/FreightCoach.java index 0416d77..a8d8cfc 100644 --- a/src/edu/kit/informatik/model/FreightCoach.java +++ b/src/edu/kit/informatik/model/FreightCoach.java @@ -22,7 +22,8 @@ public class FreightCoach extends Coach { * @param couplingBack whether the coach should have a back coupling * @throws InvalidInputException on invalid user input (zero-sized coach) */ - public FreightCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) throws InvalidInputException { + public FreightCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) + throws InvalidInputException { super(identifier, length, couplingFront, couplingBack); } diff --git a/src/edu/kit/informatik/model/ModelRailwaySimulation.java b/src/edu/kit/informatik/model/ModelRailwaySimulation.java index 6beb4bf..dad613a 100644 --- a/src/edu/kit/informatik/model/ModelRailwaySimulation.java +++ b/src/edu/kit/informatik/model/ModelRailwaySimulation.java @@ -166,6 +166,8 @@ public class ModelRailwaySimulation { case SPECIAL: coaches.put(id, new SpecialCoach(id, length, couplingFront, couplingBack)); break; + default: + throw new IllegalArgumentException("coach type is null"); } return id; } @@ -191,7 +193,7 @@ public class ModelRailwaySimulation { Terminal.printLine("No coach exists"); } else { coach: for (Integer identifier : coaches.keySet().stream().sorted().collect(Collectors.toList())) { - Coach coach = coaches.get(identifier); + Coach coach = coaches.get(identifier); for (Train train : trains.values()) { if (train.contains(coach)) { Terminal.printLine(String.format("%d %s %s %d %b %b", diff --git a/src/edu/kit/informatik/model/PassengerCoach.java b/src/edu/kit/informatik/model/PassengerCoach.java index d18565c..57981ee 100644 --- a/src/edu/kit/informatik/model/PassengerCoach.java +++ b/src/edu/kit/informatik/model/PassengerCoach.java @@ -23,7 +23,8 @@ public class PassengerCoach extends Coach { * @param couplingBack whether the coach should have a back coupling * @throws InvalidInputException on invalid user input (zero-sized coach) */ - public PassengerCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) throws InvalidInputException { + public PassengerCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) + throws InvalidInputException { super(identifier, length, couplingFront, couplingBack); } diff --git a/src/edu/kit/informatik/model/SpecialCoach.java b/src/edu/kit/informatik/model/SpecialCoach.java index 99de4fb..8d2f80c 100644 --- a/src/edu/kit/informatik/model/SpecialCoach.java +++ b/src/edu/kit/informatik/model/SpecialCoach.java @@ -24,7 +24,8 @@ public class SpecialCoach extends Coach { * @param couplingBack whether the coach should have a back coupling * @throws InvalidInputException on invalid user input (zero-sized coach) */ - public SpecialCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) throws InvalidInputException { + public SpecialCoach(int identifier, int length, boolean couplingFront, boolean couplingBack) + throws InvalidInputException { super(identifier, length, couplingFront, couplingBack); }