You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by Takashi Okamoto <to...@rd.nttdata.co.jp> on 2000/12/21 19:56:03 UTC
Re: infinite loop bug
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
Re: infinite loop bug
Posted by Jon Stevens <jo...@latchkey.com>.
on 12/21/2000 10:56 AM, "Takashi Okamoto" <to...@rd.nttdata.co.jp> wrote:
> Should you use 'currentOffset' instead of 'beginOffset' at other
> statement which is '__currentOffset = beginOffset'?
seems like that is the case. i checked your patch into cvs.
thanks!
-jon
--
Honk if you love peace and quiet.