You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Antti Valtokari <An...@iocore.fi> on 2001/03/29 11:19:28 UTC

Apache Bug Database: missing Jakarta-ORO product for bug entry

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

I found a bug from Jakarta-ORO v2.0.1. I tried to enter bug report to
Apache Bug Database, but it does not seem to contain product category
for Jakarta-ORO. Also, I found no other mean to report the bug.

Please instruct me how to report the bug correctly. I have also
attached the bug report below:

- ---- KLIP KLAP ----

The following code sample may be used reproduce infinite loop bug in
Jakarta-ORO v2.0.1. The bug exist with both the binary release and
classes compiled with Sun JDK 1.3 under Linux. The execution
environment is Borland JBuilder v4.0 with the JDK 1.3 attached.

  /* This regex performs the match as required. */
  private static String EXP = "%([a-z]*)\\(([a-z]*)\\)";

  /* Using any of the following regular expression causes infinite
loop, if
  the input string below contains three elements.

  private static String EXP = "%?%([a-z]*)\\(([a-z]*)\\)";
  private static String EXP = "(%?)%([a-z]*)\\(([a-z]*)\\)";
  private static String EXP = "(%)?%([a-z]*)\\(([a-z]*)\\)";
  private static String EXP = "[%]?%([a-z]*)\\(([a-z]*)\\)";
  private static String EXP = "([%]?)%([a-z]*)\\(([a-z]*)\\)";
  */

  private void run() throws Exception {
    PatternCompiler compiler = new Perl5Compiler();
    PatternMatcher matcher = new Perl5Matcher();
    Pattern pattern = compiler.compile(EXP);

    /* Input with three elements that cause the infinite loop. */
    PatternMatcherInput in = new
PatternMatcherInput("%a(a):%a(b):%a(c)");

    /* Using this input does not cause any problems.
    PatternMatcherInput in = new PatternMatcherInput("%a(a):%a(b)");
    */

    while(matcher.contains(in, pattern)) {
      MatchResult result = matcher.getMatch();

      for(int group = 1; group < result.groups(); group++) {
        System.out.println(group + ": " + result.group(group));
      }

      System.out.println("----------------");
    }
  }

What I am trying to do is to match patterns in format %abc(def) from
input string and substitu them with other values. The bug caused the
substitution fail with StringIndexBoundsException and it seems that
the problem is on the Perl5Matcher -class.

If the input string contains the tree matchable substrings, using any
of the expressions having the sub-pattern for preceding precent -sign
causes the while -loop to never stop. If the first expression is used
or the input contains only two matchable elements, the output is as
expected:

1: a 
2: a 
- ---------------- 
1: a 
2: b 
- ---------------- 
1: a 
2: c 
- ---------------- 

The infinite loop outputs as follows:

1: a 
2: a 
- ---------------- 
1: a 
2: b 
- ---------------- 
1: a 
2: a 
- ---------------- 
1: a 
2: b 
- ---------------- 
1: a 
2: a 
- ----------------
<and so on>
- ---- KLIP KLAP ----

- ---
Antti.Valtokari@iocore.fi                      http://www.iocore.fi/
Manager / Technology
Iocore Solutions Oy
Hiekkakiventie 7, FIN-00710 HELSINKI, FINLAND
Tel. +358-9-3747 8410, Mob. +358-50-357 5204, Fax  +358-9-3747 8900

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0

iQA/AwUBOsL+Hv3n/w+kX4ngEQKbngCbBxZwrHBc9ohVIhK2RjIAhD9r0eEAoMSL
ssIIyZDCiIVCy1J/abb2rgC+
=Ajc5
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org


Re: Apache Bug Database: missing Jakarta-ORO product for bug entry

Posted by Stefan Bodewig <bo...@apache.org>.
Antti Valtokari <An...@iocore.fi> wrote:

> I found a bug from Jakarta-ORO v2.0.1. I tried to enter bug report
> to Apache Bug Database, but it does not seem to contain product
> category for Jakarta-ORO.

It now does, please try again.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
For additional commands, e-mail: general-help@jakarta.apache.org