From 5b9f9b8da768d7737d9c4633ebdd8139c4c5fced Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Wed, 19 Feb 2020 18:47:00 +0100 Subject: [PATCH] Checkstyle --- .../kit/informatik/model/ModelRailwaySimulation.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/edu/kit/informatik/model/ModelRailwaySimulation.java b/src/edu/kit/informatik/model/ModelRailwaySimulation.java index 6f0a4f1..6beb4bf 100644 --- a/src/edu/kit/informatik/model/ModelRailwaySimulation.java +++ b/src/edu/kit/informatik/model/ModelRailwaySimulation.java @@ -477,9 +477,9 @@ public class ModelRailwaySimulation { }); // check for block collisions trains.values().stream().filter(train -> train.isPlaced() - && collisions.stream().noneMatch((x) -> x.contains(train))).forEach(train -> { + && collisions.stream().noneMatch(x -> x.contains(train))).forEach(train -> { Set occupiedByThisTrain = nextOccupiedRails.get(train); - trains.values().stream().filter((x) -> x != train).forEach((otherTrain) -> { + trains.values().stream().filter(x -> x != train).forEach(otherTrain -> { Set occupiedByOtherTrainPreviously = occupiedRails.get(otherTrain); Set occupiedByOtherTrain = nextOccupiedRails.get(otherTrain); if (occupiedByOtherTrain == null || occupiedByOtherTrainPreviously == null) { @@ -551,11 +551,11 @@ public class ModelRailwaySimulation { } // check for block collisions for (Train train : trains.values()) { - if (!train.isPlaced() || collisions.stream().anyMatch((x) -> x.contains(train))) { + if (!train.isPlaced() || collisions.stream().anyMatch(x -> x.contains(train))) { continue; // already included in collision } Set occupiedByThisTrain = nextOccupiedRails.get(train); - trains.values().stream().filter((x) -> x != train).forEach((otherTrain) -> { + trains.values().stream().filter(x -> x != train).forEach(otherTrain -> { Set occupiedByOtherTrainPreviously = occupiedRails.get(otherTrain); Set occupiedByOtherTrain = nextOccupiedRails.get(otherTrain); if (occupiedByOtherTrain == null || occupiedByOtherTrainPreviously == null) { @@ -622,7 +622,7 @@ public class ModelRailwaySimulation { .collect(Collectors.toList()); Terminal.printLine("Crash of train " + String.join(",", collision.stream().map( - (x) -> Integer.toString(x.getIdentifier())).toArray(String[]::new))); + x -> Integer.toString(x.getIdentifier())).toArray(String[]::new))); } continue train; }