Checkstyle

This commit is contained in:
Arne Keller 2020-02-19 18:49:18 +01:00
parent 5b9f9b8da7
commit 7e39a97dd4
4 changed files with 9 additions and 4 deletions

View File

@ -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);
}

View File

@ -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",

View File

@ -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);
}

View File

@ -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);
}