You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/06/21 19:25:57 UTC

svn commit: r416044 - in /incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex: DotAllQuantifierSet.java DotAllSet.java DotQuantifierSet.java FinalSet.java UMultiLineEOLSet.java WordBoundary.java

Author: tellison
Date: Wed Jun 21 10:25:56 2006
New Revision: 416044

URL: http://svn.apache.org/viewvc?rev=416044&view=rev
Log:
Applied patch HARMONY-610 (java.util.regex.Matcher.matches() fails when the default region is changed)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllQuantifierSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotQuantifierSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/FinalSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/UMultiLineEOLSet.java
    incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/WordBoundary.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllQuantifierSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllQuantifierSet.java?rev=416044&r1=416043&r2=416044&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllQuantifierSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllQuantifierSet.java Wed Jun 21 10:25:56 2006
@@ -36,7 +36,7 @@
     public int matches(int stringIndex, CharSequence testString,
             MatchResultImpl matchResult) {
 
-        int strLength = testString.length();
+        int strLength = matchResult.getRightBound();
 
         if (strLength <= stringIndex) {
             return next.matches(stringIndex, testString, matchResult);
@@ -46,7 +46,7 @@
 
     public int find(int stringIndex, CharSequence testString,
             MatchResultImpl matchResult) {
-        int strLength = testString.length();
+        int strLength = matchResult.getRightBound();
         if (next.findBack(stringIndex, strLength, testString, matchResult) >= 0) {
             return stringIndex;
         } else {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllSet.java?rev=416044&r1=416043&r2=416044&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotAllSet.java Wed Jun 21 10:25:56 2006
@@ -29,7 +29,7 @@
 class DotAllSet extends LeafSet {
 
     public int accepts(int strIndex, CharSequence testString) {
-        return (strIndex < testString.length()) ? 1 : -1;
+        return 1;
     }
 
     protected String getName() {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotQuantifierSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotQuantifierSet.java?rev=416044&r1=416043&r2=416044&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotQuantifierSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/DotQuantifierSet.java Wed Jun 21 10:25:56 2006
@@ -47,7 +47,7 @@
         findLineTerminator(stringIndex, strLength, testString);
 
         if (startSearch < 0) {
-            startSearch = testString.length();
+            startSearch = matchResult.getRightBound();
         }
 
         if (startSearch <= stringIndex) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/FinalSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/FinalSet.java?rev=416044&r1=416043&r2=416044&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/FinalSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/FinalSet.java Wed Jun 21 10:25:56 2006
@@ -35,7 +35,7 @@
     public int matches(int stringIndex, CharSequence testString,
             MatchResultImpl matchResult) {
         if (matchResult.mode() == Matcher.MODE_FIND
-                || stringIndex == testString.length()) {
+                || stringIndex == matchResult.getRightBound()) {
             matchResult.setValid();
             matchResult.setEnd(0, stringIndex);
             return stringIndex;
@@ -46,4 +46,4 @@
     protected String getName() {
         return "FinalSet";
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/UMultiLineEOLSet.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/UMultiLineEOLSet.java?rev=416044&r1=416043&r2=416044&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/UMultiLineEOLSet.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/UMultiLineEOLSet.java Wed Jun 21 10:25:56 2006
@@ -37,7 +37,7 @@
     public int matches(int strIndex, CharSequence testString,
             MatchResultImpl matchResult) {
         int strDif = matchResult.hasAnchoringBounds() ? matchResult
-                .getLeftBound()
+                .getRightBound()
                 - strIndex : testString.length() - strIndex;
         if (strDif <= 0) {
             matchResult.setConsumed(consCounter, 0);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/WordBoundary.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/WordBoundary.java?rev=416044&r1=416043&r2=416044&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/WordBoundary.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/regex/src/main/java/java/util/regex/WordBoundary.java Wed Jun 21 10:25:56 2006
@@ -40,7 +40,7 @@
         boolean left;
         boolean right;
 
-        char ch1 = stringIndex >= testString.length() ? ' ' : testString
+        char ch1 = stringIndex >= matchResult.getRightBound() ? ' ' : testString
                 .charAt(stringIndex);
         char ch2 = stringIndex == 0 ? ' ' : testString.charAt(stringIndex - 1);