[Schmitzm-commits] r2065 - 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
Thu Jun 28 01:28:08 CEST 2012


Author: alfonx
Date: 2012-06-28 01:28:08 +0200 (Thu, 28 Jun 2012)
New Revision: 2065

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	2012-06-27 23:12:10 UTC (rev 2064)
+++ trunk/schmitzm-adresses/src/main/java/de/schmitzm/adresses/AddrStringUtil.java	2012-06-27 23:28:08 UTC (rev 2065)
@@ -67,7 +67,7 @@
 		hn = RegexCache.getInstance().replaceAll(hn, "^0+", "");
 		hn = RegexCache.getInstance().replaceAll(hn, "\\s", "");
 		hn = RegexCache.getInstance().replaceAll(hn, "\\+", ",");
-		hn = RegexCache.getInstance().replaceAll(hn, "\\\\", "\\");
+		hn = RegexCache.getInstance().replaceAll(hn, Pattern.quote("\\\\"), Matcher.quoteReplacement("\\"));
 //		hn = RegexCache.getInstance().replaceAll(hn, ",", "");
 //		hn = RegexCache.getInstance().replaceAll(hn, "/", "");
 		hn = RegexCache.getInstance().replaceAll(hn, "bis", "-");

Modified: trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java
===================================================================
--- trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-06-27 23:12:10 UTC (rev 2064)
+++ trunk/schmitzm-adresses/src/test/java/de/schmitzm/adresses/AddrStringUtilTest.java	2012-06-27 23:28:08 UTC (rev 2065)
@@ -361,6 +361,7 @@
 		assertEquals("5/7", AddrStringUtil.normalizeHn("5 / 7"));
 		assertEquals("19", AddrStringUtil.normalizeHn(" 19"));
 		assertEquals("119", AddrStringUtil.normalizeHn("119"));
+		assertEquals("119\\3", AddrStringUtil.normalizeHn("119\\\\3"));
 		assertEquals("34", AddrStringUtil.normalizeHn("  34 34  "));
 		assertEquals("1", AddrStringUtil.normalizeHn("1-1"));
 		assertEquals("34", AddrStringUtil.normalizeHn("34 34"));



More information about the Schmitzm-commits mailing list