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/07 11:39:29 UTC

[jira] Created: (HARMONY-799) java.util.regex.Matcher.hitEnd() return incorrect result when hitting buffer end

java.util.regex.Matcher.hitEnd() return incorrect result when hitting buffer end
--------------------------------------------------------------------------------

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

  Components: Classlib  
    Reporter: Richard Liang


Hello,

java.util.regex.Matcher.hitEnd() will not return expected result when hitting buffer end. I met this issue when developing java.util.Scanner.

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

public void test_hitEnd() throws IOException {
        Pattern p = Pattern.compile("(\\p{Lower}+$)", Pattern.MULTILINE); //$NON-NLS-1$

        CharBuffer buf = CharBuffer.allocate(8);
        buf.position(0);
        buf.limit(4);
        String lowerSentence = "lowe3"; //$NON-NLS-1$
        StringReader stringReader = new StringReader(lowerSentence);
        stringReader.read(buf);
        buf.flip();

        Matcher matcher = p.matcher(buf);

        assertTrue(matcher.matches());
        assertTrue(matcher.hitEnd());
}


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