You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Richard Liang (JIRA)" <ji...@apache.org> on 2006/07/03 12:40:29 UTC

[jira] Created: (HARMONY-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
-----------------------------------------------------------------------------

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

  Components: Classlib  
    Reporter: Richard Liang


Hello,

java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.

The following test case will pass on RI, but fail on Harmony.

public void test_toMatchResult() {
        Pattern pattern = Pattern.compile("\\p{Lower}+");
        Matcher matcher = pattern.matcher("test");
        assertTrue(matcher.matches());
        assertEquals("test", matcher.toMatchResult().group());
}

Best regards,
Richard

-- 
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-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

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

Richard Liang updated HARMONY-730:
----------------------------------

    Attachment: regex.src.diff

Hello Tim,

The fix looks good. And here is the regression test for this issue. 
Thanks a lot.

Best regards,
Richard

> java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
> -----------------------------------------------------------------------------
>
>          Key: HARMONY-730
>          URL: http://issues.apache.org/jira/browse/HARMONY-730
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Richard Liang
>     Assignee: Tim Ellison
>  Attachments: matchResult.patch, regex.src.diff
>
> Hello,
> java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.
> The following test case will pass on RI, but fail on Harmony.
> public void test_toMatchResult() {
>         Pattern pattern = Pattern.compile("\\p{Lower}+");
>         Matcher matcher = pattern.matcher("test");
>         assertTrue(matcher.matches());
>         assertEquals("test", matcher.toMatchResult().group());
> }
> Best regards,
> Richard

-- 
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-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

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

Thanks Tim, Richard.
I'm sorry that I have not verified the fix in time, and if it's still needed(to close the bug), I confirm that everything was applied as expected.

Best regards,
   Nik.

> java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
> -----------------------------------------------------------------------------
>
>                 Key: HARMONY-730
>                 URL: http://issues.apache.org/jira/browse/HARMONY-730
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Richard Liang
>         Assigned To: Tim Ellison
>         Attachments: matchResult.patch, regex.src.diff
>
>
> Hello,
> java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.
> The following test case will pass on RI, but fail on Harmony.
> public void test_toMatchResult() {
>         Pattern pattern = Pattern.compile("\\p{Lower}+");
>         Matcher matcher = pattern.matcher("test");
>         assertTrue(matcher.matches());
>         assertEquals("test", matcher.toMatchResult().group());
> }
> Best regards,
> Richard

-- 
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-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

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

    Resolution: Fixed

Thanks Richard / Nikolay.

Patch applied to REGEX module at repo revision r418792.

Nikolay: Please check that the patch was applied as you expected.
Richard: Please confirm that this resolves your problem.

(Regression test cases always welcome too!)


> java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
> -----------------------------------------------------------------------------
>
>          Key: HARMONY-730
>          URL: http://issues.apache.org/jira/browse/HARMONY-730
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Richard Liang
>     Assignee: Tim Ellison
>  Attachments: matchResult.patch
>
> Hello,
> java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.
> The following test case will pass on RI, but fail on Harmony.
> public void test_toMatchResult() {
>         Pattern pattern = Pattern.compile("\\p{Lower}+");
>         Matcher matcher = pattern.matcher("test");
>         assertTrue(matcher.matches());
>         assertEquals("test", matcher.toMatchResult().group());
> }
> Best regards,
> Richard

-- 
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-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

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

Tim Ellison closed HARMONY-730.
-------------------------------


Verified by Nikolay.


> java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
> -----------------------------------------------------------------------------
>
>                 Key: HARMONY-730
>                 URL: http://issues.apache.org/jira/browse/HARMONY-730
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Richard Liang
>         Assigned To: Tim Ellison
>         Attachments: matchResult.patch, regex.src.diff
>
>
> Hello,
> java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.
> The following test case will pass on RI, but fail on Harmony.
> public void test_toMatchResult() {
>         Pattern pattern = Pattern.compile("\\p{Lower}+");
>         Matcher matcher = pattern.matcher("test");
>         assertTrue(matcher.matches());
>         assertEquals("test", matcher.toMatchResult().group());
> }
> Best regards,
> Richard

-- 
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-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

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

Tim Ellison reassigned HARMONY-730:
-----------------------------------

    Assign To: Tim Ellison

> java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
> -----------------------------------------------------------------------------
>
>          Key: HARMONY-730
>          URL: http://issues.apache.org/jira/browse/HARMONY-730
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Richard Liang
>     Assignee: Tim Ellison
>  Attachments: matchResult.patch
>
> Hello,
> java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.
> The following test case will pass on RI, but fail on Harmony.
> public void test_toMatchResult() {
>         Pattern pattern = Pattern.compile("\\p{Lower}+");
>         Matcher matcher = pattern.matcher("test");
>         assertTrue(matcher.matches());
>         assertEquals("test", matcher.toMatchResult().group());
> }
> Best regards,
> Richard

-- 
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-730) java.util.regex.MatcherResult.group() throws unexpected IllegalStateException

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

Nikolay Kuznetsov updated HARMONY-730:
--------------------------------------

    Attachment: matchResult.patch

This one is simple. The matchResult copy created with toMatchResult method does contain array of region bounds, but misses match result's state(successful match or not).

Fix attached.

> java.util.regex.MatcherResult.group() throws unexpected IllegalStateException
> -----------------------------------------------------------------------------
>
>          Key: HARMONY-730
>          URL: http://issues.apache.org/jira/browse/HARMONY-730
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Richard Liang
>  Attachments: matchResult.patch
>
> Hello,
> java.util.regex.MatchResult.group() throws unexpected IllegalStateException. According to the spec toMatchResult() 'Returns the match state of this matcher as a MatchResult. The result is unaffected by subsequent operations performed upon this matcher.' But, when invoking query methods on harmony MatchResult, IllegalStateException will be thrown out.
> The following test case will pass on RI, but fail on Harmony.
> public void test_toMatchResult() {
>         Pattern pattern = Pattern.compile("\\p{Lower}+");
>         Matcher matcher = pattern.matcher("test");
>         assertTrue(matcher.matches());
>         assertEquals("test", matcher.toMatchResult().group());
> }
> Best regards,
> Richard

-- 
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