[Schmitzm-commits] r2190 - in trunk/schmitzm-adresses/src: main/java/de/schmitzm/adresses test/java/de/schmitzm/adresses

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sat Jan 19 16:36:58 CET 2013


Author: alfonx
Date: 2013-01-19 16:36:58 +0100 (Sat, 19 Jan 2013)
New Revision: 2190

Modified:
   trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
   trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
Log:


Modified: trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java
===================================================================
--- trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2013-01-16 17:26:36 UTC (rev 2189)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2013-01-19 15:36:58 UTC (rev 2190)
@@ -88,9 +88,13 @@
 		Matcher m = RegexCache.getInstance().getMatcher("(\\d+)", hn);
 
 		while (m.find()) {
-			Integer h = Integer.valueOf(m.group(1));
-
-			return h;
+			try {
+				Integer h = Integer.valueOf(m.group(1));
+				return h;
+			} catch (Exception e) {
+				// #2438 Verarbeitungsfehler in ObjektAdresseDeducer / AddrStringUtil.vereinfacheHn(AddrStringUtil.java:91)
+				return null;
+			}
 		}
 
 		return null;
@@ -715,7 +719,7 @@
 		strasse = RegexCache.getInstance().replaceAll(strasse, " Der ", " der ");
 		strasse = RegexCache.getInstance().replaceAll(strasse, " Des ", " des ");
 		strasse = RegexCache.getInstance().replaceAll(strasse, "-Von-", "-von-");
-		
+
 		strasse = RegexCache.getInstance().replaceAll(strasse, "\\s*amautohof", " Am Autohof");
 		strasse = RegexCache.getInstance().replaceAll(strasse, "Autobahn\\s*A\\s*(\\d)", "Autobahn A$1");
 

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2013-01-16 17:26:36 UTC (rev 2189)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2013-01-19 15:36:58 UTC (rev 2190)
@@ -410,6 +410,7 @@
 		assertEquals(12, AddrStringUtil.vereinfacheHn("12/24"), 0);
 		assertEquals(12, AddrStringUtil.vereinfacheHn("12+13"), 0);
 		assertEquals(12, AddrStringUtil.vereinfacheHn("12 bis 24/1"), 0);
+		assertEquals(null, AddrStringUtil.vereinfacheHn("161163165167"));
 	}
 
 	@Test



More information about the Schmitzm-commits mailing list