harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-773) regex Patter2Test.testCompile4 is incorrect
Date Wed, 05 Jul 2006 16:53:30 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-773?page=all ]

Nikolay Kuznetsov updated HARMONY-773:

    Attachment: Pattern2Test.patch

The attached patch contains fix for the test mentioned in this issue.

Tim: I've mistakenly set this component for thi issues to "Non-bug differences from RI", while
this one
should probably be in "classlib category, could you please change component for this issue
or advise me what to do with it.

> regex Patter2Test.testCompile4 is incorrect
> -------------------------------------------
>          Key: HARMONY-773
>          URL: http://issues.apache.org/jira/browse/HARMONY-773
>      Project: Harmony
>         Type: Bug

>   Components: Non-bug differences from RI
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>  Attachments: Pattern2Test.patch
> The test Patter2Test.testCompile4 for regex package works incorrectly.
> Input sequence modification after creation of the matcher is invalid action, subsequent
> call should be used to update matcher with new string:
> ...
> Matcher matcher = pattern.matcher(text);
> ...
> if (found) {
>     // modify text
>     text.delete(0, text.length());
>     text.append("Text have been changed.");
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> }
> found = matcher.find();
> The spec does not specifies this case directly, but there are some considerations:
> 1) RI does not support this:
> I can easily modify this testcase to make RI fail with IndexOutOfBounsException(change
"Text have been changed"  to "AA");
> 2) Correct behaviour is not specified:
> What about concurrent modification, what should happen with ranges, should input sequense
be copied of length checks should be performed prior to every input string access operation
and so on. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message