You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2009/06/06 07:07:07 UTC

svn commit: r782192 - /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java

Author: mrglavas
Date: Sat Jun  6 05:07:07 2009
New Revision: 782192

URL: http://svn.apache.org/viewvc?rev=782192&view=rev
Log:
Fixing JIRA Issue #1377: http://issues.apache.org/jira/browse/XERCESJ-1377. Synchronize all mutations made to Context.inuse.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java?rev=782192&r1=782191&r2=782192&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xpath/regex/RegularExpression.java Sat Jun  6 05:07:07 2009
@@ -732,7 +732,7 @@
                     con.match.setBeginning(0, con.start);
                     con.match.setEnd(0, matchEnd);
                 }
-                con.inuse = false;
+                con.setInUse(false);
                 return true;
             }
             return false;
@@ -750,10 +750,10 @@
                     con.match.setBeginning(0, o);
                     con.match.setEnd(0, o+this.fixedString.length());
                 }
-                con.inuse = false;
+                con.setInUse(false);
                 return true;
             }
-            con.inuse = false;
+            con.setInUse(false);
             return false;
         }
 
@@ -766,7 +766,7 @@
             int o = this.fixedStringTable.matches(target, con.start, con.limit);
             if (o < 0) {
                 //System.err.println("Non-match in fixed-string search.");
-                con.inuse = false;
+                con.setInUse(false);
                 return false;
             }
         }
@@ -854,17 +854,17 @@
                 con.match.setBeginning(0, matchStart);
                 con.match.setEnd(0, matchEnd);
             }
-            con.inuse = false;
+            con.setInUse(false);
             return true;
         } else {
-            con.inuse = false;
+            con.setInUse(false);
             return false;
         }
     }
 
-/**
- * @return -1 when not match; offset of the end of matched string when match.
- */
+    /**
+     * @return -1 when not match; offset of the end of matched string when match.
+     */
     private int matchCharArray (Context con, Op op, int offset, int dx, int opts) {
 
         char[] target = con.charTarget;
@@ -1447,7 +1447,7 @@
                     con.match.setBeginning(0, con.start);
                     con.match.setEnd(0, matchEnd);
                 }
-                con.inuse = false;
+                con.setInUse(false);
                 return true;
             }
             return false;
@@ -1465,10 +1465,10 @@
                     con.match.setBeginning(0, o);
                     con.match.setEnd(0, o+this.fixedString.length());
                 }
-                con.inuse = false;
+                con.setInUse(false);
                 return true;
             }
-            con.inuse = false;
+            con.setInUse(false);
             return false;
         }
 
@@ -1481,7 +1481,7 @@
             int o = this.fixedStringTable.matches(target, con.start, con.limit);
             if (o < 0) {
                 //System.err.println("Non-match in fixed-string search.");
-                con.inuse = false;
+                con.setInUse(false);
                 return false;
             }
         }
@@ -1569,10 +1569,10 @@
                 con.match.setBeginning(0, matchStart);
                 con.match.setEnd(0, matchEnd);
             }
-            con.inuse = false;
+            con.setInUse(false);
             return true;
         } else {
-            con.inuse = false;
+            con.setInUse(false);
             return false;
         }
     }
@@ -2094,7 +2094,7 @@
                     con.match.setBeginning(0, con.start);
                     con.match.setEnd(0, matchEnd);
                 }
-                con.inuse = false;
+                con.setInUse(false);
                 return true;
             }
             return false;
@@ -2112,10 +2112,10 @@
                     con.match.setBeginning(0, o);
                     con.match.setEnd(0, o+this.fixedString.length());
                 }
-                con.inuse = false;
+                con.setInUse(false);
                 return true;
             }
-            con.inuse = false;
+            con.setInUse(false);
             return false;
         }
 
@@ -2128,7 +2128,7 @@
             int o = this.fixedStringTable.matches(target, con.start, con.limit);
             if (o < 0) {
                 //System.err.println("Non-match in fixed-string search.");
-                con.inuse = false;
+                con.setInUse(false);
                 return false;
             }
         }
@@ -2216,10 +2216,10 @@
                 con.match.setBeginning(0, matchStart);
                 con.match.setEnd(0, matchEnd);
             }
-            con.inuse = false;
+            con.setInUse(false);
             return true;
         } else {
-            con.inuse = false;
+            con.setInUse(false);
             return false;
         }
     }
@@ -2789,7 +2789,7 @@
 
         private void resetCommon(int nofclosures) {
             this.length = this.limit-this.start;
-            this.inuse = true;
+            setInUse(true);
             this.match = null;
             if (this.offsets == null || this.offsets.length != nofclosures)
                 this.offsets = new int[nofclosures];
@@ -2813,6 +2813,9 @@
             this.limit = limit;
             this.resetCommon(nofclosures);
         }
+        synchronized void setInUse(boolean inUse) {
+            this.inuse = inUse;
+        }
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org