Index: src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java =================================================================== --- src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java (revision 504936) +++ src/test/java/org/apache/harmony/tests/java/util/regex/MatcherTest.java (working copy) @@ -614,6 +614,41 @@ assertTrue(matcher.matches()); } + public void testAllCodePoints() { + // Regression for HARMONY-3145 + int[] codePoint = new int[1]; + Pattern p = Pattern.compile("(\\p{all})+"); + boolean res = true; + int cnt = 0; + String s; + for (int i =0; i < 0x110000; i ++) { + codePoint[0] = i; + s = new String(codePoint, 0, 1); + if (!s.matches(p.toString())) { + cnt++; + res = false; + } + } + assertTrue(res); + assertEquals(0, cnt); + + p = Pattern.compile("(\\P{all})+"); + res = true; + cnt = 0; + + for (int i =0; i < 0x110000; i ++) { + codePoint[0] = i; + s = new String(codePoint, 0, 1); + if (!s.matches(p.toString())) { + cnt++; + res = false; + } + } + + assertFalse(res); + assertEquals(0x110000, cnt); + } + /* * Verify if the Matcher behaves correct when region is changed */ Index: src/main/java/java/util/regex/AbstractCharClass.java =================================================================== --- src/main/java/java/util/regex/AbstractCharClass.java (revision 504936) +++ src/main/java/java/util/regex/AbstractCharClass.java (working copy) @@ -782,6 +782,7 @@ { "SmallFormVariants", new LazyRange(0xFE50, 0xFE6F) }, //$NON-NLS-1$ { "ArabicPresentationForms-B", new LazyRange(0xFE70, 0xFEFF) }, //$NON-NLS-1$ { "HalfwidthandFullwidthForms", new LazyRange(0xFF00, 0xFFEF) }, //$NON-NLS-1$ + { "all", new LazyRange(0x00, 0x10FFFF) }, //$NON-NLS-1$ { "Specials", new LazySpecialsBlock() }, //$NON-NLS-1$ { "Cn", new LazyCategory(Character.UNASSIGNED, true) }, { "IsL", new LazyCategoryScope(0x3E, true) },