[Schmitzm-commits] r1189 - in trunk: src/schmitzm/geotools/feature src_junit/schmitzm/geotools/feature

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 28 11:47:09 CEST 2010


Author: alfonx
Date: 2010-10-28 11:47:06 +0200 (Thu, 28 Oct 2010)
New Revision: 1189

Modified:
   trunk/src/schmitzm/geotools/feature/FeatureUtil.java
   trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java
Log:


Modified: trunk/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2010-10-27 23:48:41 UTC (rev 1188)
+++ trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2010-10-28 09:47:06 UTC (rev 1189)
@@ -2531,7 +2531,9 @@
 			
 			String s2 = Pattern.quote(localName);
 			s2 = s2.substring(2,s2.length()-2);
-			String s3 = s2.replaceAll("[^\\w]", "[^\\w]");
+			
+			// Matche irgendein nicht ASCII zeichen gegen irgenein nicht ASCII Zeichen
+			String s3 = s2.replaceAll("[^\\w]", "[^\\\\w]");
 			Pattern compile = Pattern.compile(s3);
 			Matcher matcher = compile.matcher(d.getLocalName());
 

Modified: trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java
===================================================================
--- trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java	2010-10-27 23:48:41 UTC (rev 1188)
+++ trunk/src_junit/schmitzm/geotools/feature/FeatureUtilTest.java	2010-10-28 09:47:06 UTC (rev 1189)
@@ -222,11 +222,14 @@
 		String s1 = "C�R�ALIC_1";
 		String s2 = Pattern.quote(s1);
 		s2 = s2.substring(2,s2.length()-2);
-		String s3 = s2.replaceAll("[^\\w]", "[^\\w]");
+		String s3 = s2.replaceAll("[^\\w]", "[^\\\\w]");
 //		s3 = s3.replaceAll("@", ".");
 		Pattern compile = Pattern.compile(s3);
-		Matcher matcher = compile.matcher("CóRéALIC_1");
 		
+		Matcher matcher = compile.matcher("COREALIC_1");
+		assertFalse(matcher.find());
+		
+		matcher = compile.matcher("CóRéALIC_1");
 		assertTrue(matcher.find());
 		
 	}



More information about the Schmitzm-commits mailing list