harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r542290 - in /harmony/enhanced/classlib/trunk/modules/regex/src: main/java/java/util/regex/AbstractCharClass.java test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java
Date Mon, 28 May 2007 18:42:33 GMT
Author: ayza
Date: Mon May 28 11:42:32 2007
New Revision: 542290

URL: http://svn.apache.org/viewvc?view=rev&rev=542290
Log:
Applying patch from HARMONY-3360 ([classlib][regex][EUT] 5 tests fail in org.eclipse.ui.workbench.texteditor.tests
suit)

Modified:
    harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/AbstractCharClass.java
    harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java

Modified: harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/AbstractCharClass.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/AbstractCharClass.java?view=diff&rev=542290&r1=542289&r2=542290
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/AbstractCharClass.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/AbstractCharClass.java
Mon May 28 11:42:32 2007
@@ -381,7 +381,7 @@
                 chCl.lowHighSurrogates.set(0, SURROGATE_CARDINALITY);
             }
 
-            chCl.mayContainSupplCodepoints = mayContainSupplCodepoints;;
+            chCl.mayContainSupplCodepoints = mayContainSupplCodepoints;
             return chCl;
         }
     }
@@ -808,7 +808,13 @@
                 { "Cf", new LazyCategory(Character.FORMAT, true) },
                 { "Co", new LazyCategory(Character.PRIVATE_USE, true) },
                 { "Cs", new LazyCategory(Character.SURROGATE, false, true) },
-                { "IsP", new LazyCategoryScope(0xF8000, true) },
+                {"IsP", new LazyCategoryScope((1 << Character.DASH_PUNCTUATION) |
+                        (1 << Character.START_PUNCTUATION) |
+                        (1 << Character.END_PUNCTUATION) |
+                        (1 << Character.CONNECTOR_PUNCTUATION) |
+                        (1 << Character.OTHER_PUNCTUATION) |
+                        (1 << Character.INITIAL_QUOTE_PUNCTUATION) |
+                        (1 << Character.FINAL_QUOTE_PUNCTUATION), true)},
                 { "Pd", new LazyCategory(Character.DASH_PUNCTUATION, false) },
                 { "Ps", new LazyCategory(Character.START_PUNCTUATION, false) },
                 { "Pe", new LazyCategory(Character.END_PUNCTUATION, false) },

Modified: harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java?view=diff&rev=542290&r1=542289&r2=542290
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/regex/src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java
Mon May 28 11:42:32 2007
@@ -700,6 +700,20 @@
         assertFalse(m.find());
     }
 
+    /**
+     * Regression test for HARMONY-3360
+     */
+    public void testGeneralPunctuationCategory() {
+        String[] s = {",", "!", "\"", "#", "%", "&", "'", "(", ")", "-", ".", "/"};
+        String regexp = "\\p{P}";
+
+        for (int i = 0; i < s.length; i++) {
+            Pattern pattern = Pattern.compile(regexp);
+            Matcher matcher = pattern.matcher(s[i]);
+            assertTrue(matcher.find());
+        }
+    }
+
 
     public static void main(String[] args) {
 		junit.textui.TestRunner.run(MatcherTest.class);



Mime
View raw message