Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 23268 invoked from network); 7 Aug 2006 09:04:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Aug 2006 09:04:04 -0000 Received: (qmail 64376 invoked by uid 500); 7 Aug 2006 09:04:03 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 64347 invoked by uid 500); 7 Aug 2006 09:04:03 -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 64336 invoked by uid 99); 7 Aug 2006 09:04:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2006 02:04:03 -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; Mon, 07 Aug 2006 02:03:56 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9837B7142D0 for ; Mon, 7 Aug 2006 09:00:35 +0000 (GMT) Message-ID: <27545565.1154941235620.JavaMail.jira@brutus> Date: Mon, 7 Aug 2006 02:00:35 -0700 (PDT) From: "Alexey Petrenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-62) java.text.BreakIterator.getSentenceInstance().next() treats '\n' as the end of the sentence 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-62?page=comments#action_12426172 ] Alexey Petrenko commented on HARMONY-62: ---------------------------------------- java.text.BreakIterator.getSentenceInstance() returns a wraper for com.ibm.icu.text.BreakIterator.getLineInstance() result. So it's probably ICU bug. > java.text.BreakIterator.getSentenceInstance().next() treats '\n' as the end of the sentence > ------------------------------------------------------------------------------------------- > > Key: HARMONY-62 > URL: http://issues.apache.org/jira/browse/HARMONY-62 > Project: Harmony > Issue Type: Bug > Components: Classlib > Reporter: tatyana doubtsova > > Problem details: > java.text.BreakIterator.getSentenceInstance().next() stops searching for the sentence end, if the new-line character is found in the text and returns the index of the last seen non white space character. Due to j2se 1.4.2 method next() should return the boundary following the current boundary. > Code for reproducing Test.java: > import java.text.BreakIterator; > public class Test { > public static void main(String [] args) > { > BreakIterator it = BreakIterator.getSentenceInstance(); > it.setText("One sentence \n on two lines."); > System.out.println(it.next()); > } > } > Steps to Reproduce: > 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. > 2. Compile Test.java using BEA 1.4 javac > > javac -d . Test.java > 3. Run java using compatible VM (J9) > > java -showversion Test > Output: > java version 1.4.2 (subset) > (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. > 14 > Output on BEA 1.4.2 to compare with: > 28 > Suggested junit test case: > package org.apache.harmony.tests.java.text; > import java.text.BreakIterator; > import java.util.Locale; > import junit.framework.TestCase; > public class BreakIteratorTest extends TestCase { > public void test_next() { > // Regression test for HARMONY-30 > BreakIterator bi = BreakIterator.getWordInstance(Locale.US); > bi.setText("This is the test, WordInstance"); > int n = bi.first(); > n = bi.next(); > assertEquals("Assert 0: next() returns incorrect value ", 4, n); > // Regression test for the current issue > bi = BreakIterator.getSentenceInstance(); > bi.setText("One sentence \n on two lines."); > n = bi.next(); > assertEquals("Assert 1: next() returns incorrect value ", 28, n); > } > } -- 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