# HG changeset patch # User Sascha L. Teichmann # Date 1342167913 0 # Node ID 5e52202302e543827326aaf945dd05969f125e1b # Parent c15738c831dbd0aa5c3fbb69dd8e2a311a39d295 SQ relation: Handle the error case of accessing wrong indexed SQ relation more smoothly. flys-artifacts/trunk@4973 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r c15738c831db -r 5e52202302e5 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Jul 12 22:27:50 2012 +0000 +++ b/flys-artifacts/ChangeLog Fri Jul 13 08:25:13 2012 +0000 @@ -1,3 +1,9 @@ +2012-07-13 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/sq/Measurements.java: + Handle the error case of accessing wrong indexed SQ relation + more smoothly. + 2012-07-13 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/model/sq/Measurement.java: diff -r c15738c831db -r 5e52202302e5 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Measurements.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Measurements.java Thu Jul 12 22:27:50 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Measurements.java Fri Jul 13 08:25:13 2012 +0000 @@ -1,10 +1,14 @@ package de.intevation.flys.artifacts.model.sq; +import java.util.ArrayList; import java.util.List; -import java.util.ArrayList; + +import org.apache.log4j.Logger; public class Measurements { + private static final Logger log = Logger.getLogger(Measurements.class); + public interface SExtractor { double getS(Measurement measument); } // interface SExtractor @@ -104,8 +108,8 @@ case 4: return S_BL_CG(); case 5: return S_BL(); } - // XXX: Should we throw an exception? - return null; + log.error("THIS SHOULD NOT HAPPEN: Tried to access SQ[" + index + "]"); + return new ArrayList(0); } @Override