comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQSelect.java @ 352:ed3325a0232a

Throw an illegal argument exception in LocationDistanceSelect.validate() and WQSelect.validate() if no data has been inserted so far. flys-artifacts/trunk@1759 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 28 Apr 2011 11:08:34 +0000
parents 448d0dc64357
children c21fb8de54f8
comparison
equal deleted inserted replaced
351:2d268f9894bb 352:ed3325a0232a
200 logger.debug("WQ Mode: " + mode); 200 logger.debug("WQ Mode: " + mode);
201 201
202 String fromStr = (String) data.get(WQ_FROM).getValue(); 202 String fromStr = (String) data.get(WQ_FROM).getValue();
203 String toStr = (String) data.get(WQ_TO).getValue(); 203 String toStr = (String) data.get(WQ_TO).getValue();
204 String stepStr = (String) data.get(WQ_STEP).getValue(); 204 String stepStr = (String) data.get(WQ_STEP).getValue();
205
206 if (fromStr == null || toStr == null || stepStr == null) {
207 throw new IllegalArgumentException("error_empty_state");
208 }
205 209
206 double from = Double.parseDouble(fromStr); 210 double from = Double.parseDouble(fromStr);
207 double to = Double.parseDouble(toStr); 211 double to = Double.parseDouble(toStr);
208 double step = Double.parseDouble(stepStr); 212 double step = Double.parseDouble(stepStr);
209 213

http://dive4elements.wald.intevation.org