From 2d153b8b34ad6e7523471645ca7c348cad0196cd Mon Sep 17 00:00:00 2001 From: Felix Kehrer Date: Thu, 14 Jun 2018 22:07:16 +0200 Subject: Remove redundant logging of validation errors #27033 --- .../einsatzverwaltung/service/VehicleServiceImpl.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java index 929856e..0bf4aa6 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java @@ -11,16 +11,12 @@ import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException; import java.util.EnumSet; import java.util.Set; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @Service public class VehicleServiceImpl implements VehicleService { - private static final Logger LOG = LoggerFactory.getLogger(VehicleServiceImpl.class); - private VehicleDAO vehiclePersistence; public VehicleServiceImpl(VehicleDAO vehiclePersistence) { @@ -29,7 +25,6 @@ public class VehicleServiceImpl implements VehicleService { public long add(Vehicle vehicle) throws InvalidVehicleException, ServiceException { if (!CollectionUtils.isEmpty(vehicle.registrations())) { - LOG.info("Invalid Vehicle: Vehicle cannot be created with registrations"); throw new InvalidVehicleException( "Fahrzeug kann nicht mit Anmeldungen erstellt werden"); } @@ -59,41 +54,32 @@ public class VehicleServiceImpl implements VehicleService { switch (vehicle.type()) { case RTW: if (vehicle.constructionType() == ConstructionType.NORMAL) { - LOG.info("Invalid Vehicle: RTW cannot have a normal roof"); throw new InvalidVehicleException("RTW darf kein Normales Dach haben"); } else if (vehicle.constructionType() == ConstructionType.MITTELHOCHDACH) { - LOG.info("Invalid Vehicle: RTW cannot have a medium roof"); throw new InvalidVehicleException("RTW darf kein Mittelhochdach haben"); } break; case KTW: if (vehicle.constructionType() == ConstructionType.NORMAL) { - LOG.info("Invalid Vehicle: KTW cannot have a normal roof"); throw new InvalidVehicleException("KTW darf kein Normales Dach haben"); } break; case KTW_B: if (vehicle.constructionType() == ConstructionType.NORMAL) { - LOG.info("Invalid Vehicle: KTW-B cannot have a normal roof"); throw new InvalidVehicleException("KTW-B darf kein Normales Dach haben"); } break; case NEF: if (vehicle.constructionType() == ConstructionType.MITTELHOCHDACH) { - LOG.info("Invalid Vehicle: NEF cannot have a medium roof"); throw new InvalidVehicleException("NEF darf kein Mittelhochdach haben"); } else if (vehicle.constructionType() == ConstructionType.HOCHDACH) { - LOG.info("Invalid Vehicle: NEF cannot have a high roof"); throw new InvalidVehicleException("NEF darf kein Hochdach haben"); } break; case NAH: if (vehicle.constructionType() == ConstructionType.MITTELHOCHDACH) { - // TODO: eventually change to LOG.debug (feedback) - LOG.info("Invalid Vehicle: NAH cannot have a medium roof"); throw new InvalidVehicleException("NEF darf kein Mittelhochdach haben"); } else if (vehicle.constructionType() == ConstructionType.HOCHDACH) { - LOG.info("Invalid Vehicle: NAH cannot have a high roof"); throw new InvalidVehicleException("NEF darf kein Hochdach haben"); } break; @@ -107,8 +93,7 @@ public class VehicleServiceImpl implements VehicleService { @Override public Set list(EnumSet statuses) throws ServiceException { if (statuses == null) { - LOG.error("Statuses may not be null"); - throw new ServiceException("statuses may not be null"); + throw new ServiceException("Statuses may not be null"); } Set vehicles; -- cgit v1.2.3-70-g09d2