aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kehrer <felix.kehrer@gmail.com>2018-06-14 21:45:58 +0200
committerTharre <tharre3@gmail.com>2018-06-16 17:37:48 +0200
commit2a8dfff0948ca196d9a4fc4e6a8c45759e9f7dca (patch)
tree5f07e84532c8a203ce30822999302b38c25c655b
parentdc6f5a0fdd481fe6934c6aebe3636060582fb8bc (diff)
downloadsepm-groupproject-2a8dfff0948ca196d9a4fc4e6a8c45759e9f7dca.tar.gz
sepm-groupproject-2a8dfff0948ca196d9a4fc4e6a8c45759e9f7dca.tar.xz
sepm-groupproject-2a8dfff0948ca196d9a4fc4e6a8c45759e9f7dca.zip
Removed redundant logs of InvalidXExceptions #27033
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java
index 497c6bc..20a3106 100644
--- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java
@@ -49,17 +49,14 @@ public class OperationServiceImpl implements OperationService {
@Override
public long add(Operation o) throws InvalidOperationException, ServiceException {
if (o.created() != null) {
- LOG.info("Invalid Operation: Created must be null");
throw new InvalidOperationException("Erstellungszeitpunkt darf nicht gesetzt sein");
}
if (o.severity() != null) {
- LOG.info("Invalid Operation: Severity must be null");
throw new InvalidOperationException("Der Schweregrad darf nicht gesetzt sein");
}
if (o.id() != 0) {
- LOG.info("Invalid Operation: OperationId must be 0");
throw new InvalidOperationException("Einsatz-ID muss 0 sein");
}
@@ -101,7 +98,6 @@ public class OperationServiceImpl implements OperationService {
try {
if (operationId <= 0) {
- LOG.info("Invalid Operation: OperationId is invalid (<= 0)");
throw new InvalidOperationException("Einsatz-ID ist ungültig");
}
Operation o = operationDAO.get(operationId);
@@ -109,23 +105,19 @@ public class OperationServiceImpl implements OperationService {
if (o.opCode().trim().isEmpty()
|| extractSeverityFromOpCode(o.opCode()) != o.severity()) {
- LOG.info("Invalid Operation: OpCode does not match Severity");
throw new InvalidOperationException("Einsatzcode ist ungültig");
}
if (o.status() != Status.ACTIVE) {
- LOG.info("Invalid Operation: Operation is not active");
throw new InvalidOperationException("Einsatz ist ungültig");
}
if (o.created() == null) {
- LOG.info("Invalid Operation: Created field is null");
throw new InvalidOperationException("Erstellungszeitpunkt darf nicht leer sein");
}
for (Long id : vehicleIds) {
if (id <= 0) {
- LOG.info("Invalid Vehicle: VehicleId is not valid");
throw new InvalidVehicleException("Fahrzeug-ID ist ungültig");
}
@@ -246,7 +238,6 @@ public class OperationServiceImpl implements OperationService {
private static void validateOperation(Operation o) throws InvalidOperationException {
if (o.vehicles().isEmpty()) {
- LOG.info("Invalid Operation: No vehicle was added");
throw new InvalidOperationException(
"Es muss mindestens ein Fahrzeug ausgewählt werden!");
}
@@ -263,12 +254,10 @@ public class OperationServiceImpl implements OperationService {
Instant created = o.created();
if (created != null && created.isAfter(Instant.now())) {
- LOG.info("Invalid Operation: Operation was created in the future");
throw new InvalidOperationException("Einsatz wurde in der Zukunft erstellt");
}
if (o.destination().trim().isEmpty()) {
- LOG.info("Invalid Operation: Adress must not be empty");
throw new InvalidOperationException("Adresse darf nicht leer sein");
}
}
@@ -281,7 +270,6 @@ public class OperationServiceImpl implements OperationService {
Matcher m = opCodePattern.matcher(opCode);
if (!m.matches()) {
- LOG.info("Invalid Operation: OpCode is invalid");
throw new InvalidOperationException("Einsatzcode ist invalid");
}