jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takashi Okamoto" <tokam...@rd.nttdata.co.jp>
Subject Re: infinite loop bug
Date Thu, 21 Dec 2000 18:56:03 GMT
Hello ,daniel and jon.

>> I have found a bug in ORO 2.0.1 (binary release) that was not in ORO
>> 2.0.  The code below should loop through getting all XML style tags,
>> but instead goes into an infinite loop.  If you change the pattern to
>> "<[^>]*>" it works fine under either version.  I am using JDK 1.2.2 on
>> WinNT 4.0 sp5.

> From looking at your sample code, it's gotta be caused by the
> changes to the handling of PatternMatcherInput between 2.0 and
> 2.0.1.

I fixed infinite loop bug.
Please take this patch.

-------------
--- src/java/org/apache/oro/text/regex/Perl5Matcher.java.orig Fri Dec 22
03:23:06 2000
+++ src/java/org/apache/oro/text/regex/Perl5Matcher.java Fri Dec 22 03:24:49
2000
@@ -327,7 +327,7 @@
    mustString = expression._mustString = null;
    __currentOffset = beginOffset;
  } else {
-   __currentOffset = beginOffset;
+   __currentOffset = currentOffset;
    minLength = mustString.length;
  }
       }
-----------

Should you use 'currentOffset' instead of 'beginOffset' at other
statement which is '__currentOffset = beginOffset'?

Regards.
------------------
Takashi Okamoto



Mime
View raw message