harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-799) java.util.regex.Matcher.hitEnd() return incorrect result when hitting buffer end
Date Fri, 07 Jul 2006 09:39:29 GMT
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


Mime
View raw message