You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Radu marias (JIRA)" <ji...@apache.org> on 2007/07/09 12:16:04 UTC

[jira] Created: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

[classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
-------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4396
                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: OS: Linux openSUSE 10.2, JDK 1.6
            Reporter: Radu marias
            Priority: Minor


If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.

The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
The source of changed method:

    private int findAt(int startIndex) {
        matchResult.reset();
        matchResult.setMode(Matcher.MODE_FIND);
        matchResult.setStartIndex(startIndex);
        int foundIndex = start.find(startIndex, string, matchResult);
        if (foundIndex == -1) {
            matchResult.hitEnd = true;
        }
        return foundIndex;
    }

Attachments:
HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Attachment: HitEndTest.java

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: HitEndTest.java, HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12511162 ] 

Tim Ellison commented on HARMONY-4396:
--------------------------------------

Thanks Radu.

Just a heads up to committers that the attachments here do not have Radu's authorization for inclusion in Harmony.  In particular the test case has explicitly reserved all rights so we cannot incorporate it directly (and therefore have to write an alternative regression test).

(If that was not your intention Radu, please re-attach the code with the "Grant license to ASF for inclusion in ASF works..." radio button selected and an amended comment block).


> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Attachment:     (was: HitEndTest.java)

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Attachment:     (was: HitEndTest.java)

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Priority: Minor
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison closed HARMONY-4396.
--------------------------------


> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Attachment: Matcher.java
                HitEndTest.java

HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
Matcher.java: the fixed file.

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Attachment: Matcher.java
                HitEndTest.java

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Comment: was deleted

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-4396:
------------------------------------

    Assignee: Tim Ellison

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Radu Marias (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Marias updated HARMONY-4396:
---------------------------------

    Attachment:     (was: Matcher.java)

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Priority: Minor
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-4396.
----------------------------------

    Resolution: Fixed

Finally integrated regression test case, with my humble apologies for the delay.

Committed to REGEX module at repo revision r590138.


> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-4396) [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515326 ] 

Tim Ellison commented on HARMONY-4396:
--------------------------------------

Radu,

The fix has been applied to the REGEX module at repo revision r559497.

I have not integrated your regression test because:
 - although you granted the ASF a license through the JIRA attachment tool, the source still contains a copyright and "All rights reserved" comment and (in keeping with the ASF procedures [1]) I need permission to remove the comments, or you should remove them, and
 - we need you to say that Danger Research Inc allow you to contribute their code to Harmony, which happens via a short questionnaire you can find here [2].  Take a read and send it back to me so we know where you are free to contribute

Thanks again for fixing this problem!

[1] http://www.apache.org/legal/src-headers.html#headers
[2] http://harmony.apache.org/auth_cont_quest.txt

> [classlib][regex] Matcher.hitEnd() returns invalid value if a match isn't found after find() method is called
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4396
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4396
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: OS: Linux openSUSE 10.2, JDK 1.6
>            Reporter: Radu Marias
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: HitEndTest.java, Matcher.java
>
>
> If Matcher.find() is called and there's no match found, the Matcher.hitEnd() returns false event thought when it's tried to get the index of the match that index is -1 (witch means that a match isn't found).
> The problem is that matchResult.hitEnd isn't set to true when the index of found match is -1.
> The fix is a little change to "private int findAt(int startIndex)" method to set matchResult.hitEnd to true when a match isn't found.
> The source of changed method:
>     private int findAt(int startIndex) {
>         matchResult.reset();
>         matchResult.setMode(Matcher.MODE_FIND);
>         matchResult.setStartIndex(startIndex);
>         int foundIndex = start.find(startIndex, string, matchResult);
>         if (foundIndex == -1) {
>             matchResult.hitEnd = true;
>         }
>         return foundIndex;
>     }
> Attachments:
> HitEndTest.java: test case, testHitEndAfterFind() is the test it fails.
> Matcher.java: the fixed file.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.