From 5bf05616c82b509aa2284cd266316497753507a7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 Apr 2019 15:43:10 +0200 Subject: [PATCH] reworked checks to work with double instead of Double --- .../java/hhn/labsw/bugageocaching/controller/Controller.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java index 1c17bd0..8c5af5c 100644 --- a/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java +++ b/src/main/java/hhn/labsw/bugageocaching/controller/Controller.java @@ -156,7 +156,7 @@ public class Controller { } } - if (cache.getDescription().length() == 0 || cache.getName().length() == 0 || Double.valueOf(cache.getRankingPoints()) == null || cache.getStationen().size() == 0) { + if (cache.getDescription().length() == 0 || cache.getName().length() == 0 || cache.getRankingPoints() == 0.0 || cache.getStationen().size() == 0) { deleteStationen(cache); return ResponseEntity.status(400).body("cache fields can´t be empty"); } @@ -188,7 +188,7 @@ public class Controller { public ResponseEntity createStation(Station station) { - if (station.getDescription().length() == 0 || Double.valueOf(station.getLattitude()) == null || Double.valueOf(station.getLongitude()) == null || station.getSolution().length() == 0) { + if (station.getDescription().length() == 0 || station.getLattitude() == 0.0 || station.getLongitude() == 0.0 || station.getSolution().length() == 0) { return ResponseEntity.status(400).body("station fields can´t be empty"); }