You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org> on 2006/04/14 19:29:00 UTC

[jira] Created: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

HARMONY-39 Regular expressions does not match backreferences during find.
-------------------------------------------------------------------------

         Key: HARMONY-350
         URL: http://issues.apache.org/jira/browse/HARMONY-350
     Project: Harmony
        Type: Bug

  Components: Classlib  
 Environment: All
    Reporter: Nikolay Kuznetsov
    Priority: Minor


For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.

While fixing this problem the following simple issues was also found and fixed:

- Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.

- Boundaries where embedded flags are in effect are not correctly processed:
      - Whitespaces being ignored after group which nested comment flag;
      - Global embedded flags do not mix with local once;
      - Minus sign in embedded flags automatically removes case insensitive flag;

The attached patch will address all mentioned above broblems.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-350?page=all ]

Mikhail Loenko reassigned HARMONY-350:
--------------------------------------

    Assign To: Mikhail Loenko

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-350?page=comments#action_12374833 ] 

Mikhail Loenko commented on HARMONY-350:
----------------------------------------

The patch causes test failure:

Class: tests.api.java.util.regex.PatternSyntaxExceptionTest
Test: testCase

expected:<1> but was:<2>

junit.framework.AssertionFailedError: expected:<1> but was:<2> at tests.api.java.util.regex.PatternSyntaxExceptionTest.testCase(PatternSyntaxExceptionTest.java:37) at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)

 (the test was enabled by H-352)

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-350?page=comments#action_12374890 ] 

Nikolay Kuznetsov commented on HARMONY-350:
-------------------------------------------

This fix and issue overall does not deal with indices in exceptions. The problem here is that patch from HARMONY-352 interfere with this patch and result of the conflict resolution lacks HARMONY-352 fix for pattern(wich I'm concerned about, see H-352 for details).

I can attach single patch for both problems H-350 and Pattern.java part of the H-352 or, if it possible to commit this one as is, I can provide separate patch for H-352 part of the problem.

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-350?page=all ]

Nikolay Kuznetsov updated HARMONY-350:
--------------------------------------

    Attachment: groups.diff

Fix for this issue

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Priority: Minor
>  Attachments: groups.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-350?page=all ]
     
Mikhail Loenko closed HARMONY-350:
----------------------------------


verified by Nikolay

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff, groups2.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Mikhail Loenko (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-350?page=all ]
     
Mikhail Loenko resolved HARMONY-350:
------------------------------------

    Resolution: Fixed

fixed in revision 395158
Nikolay, please verify that it fully resolves the problem

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff, groups2.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-350?page=comments#action_12375079 ] 

Nikolay Kuznetsov commented on HARMONY-350:
-------------------------------------------

Looks good, thanks a lot.

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff, groups2.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-350) HARMONY-39 Regular expressions does not match backreferences during find.

Posted by "Nikolay Kuznetsov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-350?page=all ]

Nikolay Kuznetsov updated HARMONY-350:
--------------------------------------

    Attachment: groups2.diff

Suggested patch fixes both HARMONY-350 issue and incorrect indices in PatternSyntaxException(see HARMONY-352 for details). 

> HARMONY-39 Regular expressions does not match backreferences during find.
> -------------------------------------------------------------------------
>
>          Key: HARMONY-350
>          URL: http://issues.apache.org/jira/browse/HARMONY-350
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>  Environment: All
>     Reporter: Nikolay Kuznetsov
>     Assignee: Mikhail Loenko
>     Priority: Minor
>  Attachments: groups.diff, groups2.diff
>
> For the optimization purposes match and find methods of HARMONY-39 regex works differently. One of the differences that cause some problems is that group boundaries are being set in different time (onward, in case of match and on the way back in the case of find). Thus back references "\1-9" won't work as expected in case of find method (because in case of find boundaries are not yet set when back reference appears). The same problem appears if pattern contains ".*", where we try to simulate find and face the same problem.
> While fixing this problem the following simple issues was also found and fixed:
> - Empty constructs are not being processed correctly. The examples of this construct are empty group(i.e. "()"), or empty alternation(i.e. "|") and combinations with embedded flags, which do not match actual characters. In all cases HARMONY-39 engine throws PatternSyntaxException instead of returning token representing empty construct.
> - Boundaries where embedded flags are in effect are not correctly processed:
>       - Whitespaces being ignored after group which nested comment flag;
>       - Global embedded flags do not mix with local once;
>       - Minus sign in embedded flags automatically removes case insensitive flag;
> The attached patch will address all mentioned above broblems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira