[Dive4elements-commits] [PATCH] Change IllegalArgumentException to HibernateException
Wald Commits
scm-commit at wald.intevation.org
Thu Mar 7 10:46:37 CET 2013
# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1362649467 -3600
# Node ID 9d36ddf7dbd311e85973412108d06984858484cf
# Parent 520b4fea63bb26688032eb8e8776ffbcc3d18db8
Change IllegalArgumentException to HibernateException.
diff -r 520b4fea63bb -r 9d36ddf7dbd3 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java Thu Mar 07 10:22:30 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java Thu Mar 07 10:44:27 2013 +0100
@@ -50,6 +50,7 @@
import org.geotools.feature.FeatureCollection;
import org.geotools.feature.FeatureCollections;
import org.geotools.feature.simple.SimpleFeatureBuilder;
+import org.hibernate.HibernateException;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
@@ -621,7 +622,7 @@
try {
axes = RiverAxis.getRiverAxis(river);
}
- catch (IllegalArgumentException iae) {
+ catch (HibernateException iae) {
logger.warn("No valid river axis found for " + river);
return;
}
diff -r 520b4fea63bb -r 9d36ddf7dbd3 flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java Thu Mar 07 10:22:30 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java Thu Mar 07 10:44:27 2013 +0100
@@ -30,6 +30,7 @@
import org.geotools.geometry.jts.JTS;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.referencing.CRS;
+import org.hibernate.HibernateException;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.referencing.FactoryException;
@@ -71,7 +72,7 @@
return max;
}
}
- catch(IllegalArgumentException iae) {
+ catch(HibernateException iae) {
logger.warn("No vaild river axis forund for " + rivername);
return null;
}
diff -r 520b4fea63bb -r 9d36ddf7dbd3 flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java Thu Mar 07 10:22:30 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/RiverMapfileGenerator.java Thu Mar 07 10:44:27 2013 +0100
@@ -20,6 +20,7 @@
import org.apache.log4j.Logger;
import org.apache.velocity.Template;
+import org.hibernate.HibernateException;
public class RiverMapfileGenerator extends MapfileGenerator {
@@ -70,7 +71,7 @@
try {
riverAxis = RiverAxis.getRiverAxis(river.getName());
}
- catch (IllegalArgumentException iae) {
+ catch (HibernateException iae) {
logger.error("No valid riveraxis found for " + river.getName());
continue;
}
diff -r 520b4fea63bb -r 9d36ddf7dbd3 flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java
--- a/flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java Thu Mar 07 10:22:30 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/backend/SpatialInfo.java Thu Mar 07 10:44:27 2013 +0100
@@ -4,6 +4,7 @@
import org.apache.log4j.Logger;
+import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -93,7 +94,7 @@
logger.warn("River has no RiverAxis.");
}
}
- catch(IllegalArgumentException iae) {
+ catch(HibernateException iae) {
logger.warn("No vaild river axis found for " + river.getName());
return;
}
diff -r 520b4fea63bb -r 9d36ddf7dbd3 flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java
--- a/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java Thu Mar 07 10:22:30 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/RiverAxis.java Thu Mar 07 10:44:27 2013 +0100
@@ -107,20 +107,15 @@
}
public static List<RiverAxis> getRiverAxis(String river, int kind)
- throws IllegalArgumentException {
+ throws HibernateException {
Session session = SessionHolder.HOLDER.get();
Query query = session.createQuery(
"from RiverAxis where river.name =:river AND kind.id =:kind");
query.setParameter("river", river);
query.setParameter("kind", kind);
- try {
- List<RiverAxis> list = query.list();
- return list.isEmpty() ? null : list;
- }
- catch (RuntimeException re) {
- throw re.getCause();
- }
+ List<RiverAxis> list = query.list();
+ return list.isEmpty() ? null : list;
}
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
More information about the Dive4elements-commits
mailing list