Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 92072 invoked from network); 11 Oct 2006 12:40:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2006 12:40:10 -0000 Received: (qmail 9142 invoked by uid 500); 11 Oct 2006 12:40:10 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 9108 invoked by uid 500); 11 Oct 2006 12:40:10 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 9097 invoked by uid 99); 11 Oct 2006 12:40:10 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 05:40:10 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 05:40:09 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E9B527142E4 for ; Wed, 11 Oct 2006 05:39:28 -0700 (PDT) Message-ID: <28032874.1160570368955.JavaMail.root@brutus> Date: Wed, 11 Oct 2006 05:39:28 -0700 (PDT) From: "Anton Ivanov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-688) java.util.regex.Matcher does not support Unicode supplementary characters In-Reply-To: <32568614.1151482589780.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-688?page=all ] Anton Ivanov updated HARMONY-688: --------------------------------- Attachment: patch_src_corrected.txt I corrected the patch (patch_src.txt) and attached it to the issue (patch_src_corrected.txt). I verified that regex and luni tests pass normally with the patch applied. There was a bug in the newly created class SupplRangeSet.java. There was the following code in the method matches() of SupplRangeSet.java: ... if (stringIndex < strLength) { char high = testString.charAt(stringIndex++); if (contains(high) && next.matches(stringIndex, testString, matchResult) > 0) { return 1; } ... But it is wrong simply to return 1, though we can read about method matches() in AbstractSet.java comments: "Checks if this node matches in given position and recursively call next node matches on positive self match. Returns positive integer if entire match succeed, negative otherwise return -1 if match fails or n > 0;" In fact method matches() returns not only a positive n > 0. The n is an offset in case of a positive match attempt. This fact is took into account in all old classes of java.util.regex, but I forgot this fact in SupplRangeSet.java So I corrected method matches() of the SupplRangeSet class as follows: ... int offset = -1; if (stringIndex < strLength) { char high = testString.charAt(stringIndex++); if (contains(high) && (offset = next.matches(stringIndex, testString, matchResult)) > 0) { return offset; } ... Thanks, Anton > java.util.regex.Matcher does not support Unicode supplementary characters > ------------------------------------------------------------------------- > > Key: HARMONY-688 > URL: http://issues.apache.org/jira/browse/HARMONY-688 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: Richard Liang > Assigned To: Tim Ellison > Attachments: patch_src.txt, patch_src_corrected.txt, patch_tests.txt > > > Hello Nikolay, > The following test case pass on RI, but fail on Harmony. Would you please have a look at this issue? Thanks a lot. > public void test_matcher() { > Pattern p = Pattern.compile("\\p{javaLowerCase}"); > Matcher matcher = p.matcher("\uD801\uDC28"); > assertTrue(matcher.find()); > } > 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