Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4638211

BreakIterator.getLineInstance() broken in 1.4.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs



      Name: gm110360 Date: 02/14/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)


      FULL OPERATING SYSTEM VERSION :
      kernel = 2.4.8-26mdksmp
      glibc = glibc-2.2.4-6mdk
      distro = Mandrake Linux release 8.1

      A DESCRIPTION OF THE PROBLEM :
      BreakIterator.getLineInstance() is breaking on embedded
      periods in a line. For instance sun.com breaks into "sun."
      and "com". This was reported to have been fixed if you look
      at bug 4242585, but if you try the test on newly released
      1.4.0 you can see that it isn't.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. See test case in bug 4242585
       to reproduce.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      See 4242585 for expected/actual results.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.text.*;
      import java.util.*;

      public class Yikes {

              public static void main(String args[]) {
                      String stringToExamine = "sun.com";
                      BreakIterator boundary =
      BreakIterator.getLineInstance(Locale.US);
                      boundary.setText(stringToExamine);
                      printEachForward(boundary, stringToExamine);
             }


             public static void printEachForward(BreakIterator myIter, String source)
      {
                 int start = myIter.first();
                 for (int end = myIter.next();
                      end != BreakIterator.DONE;
                      start = end, end = myIter.next()) {
                      System.out.println(source.substring(start,end));
                 }
             }

      }

      ---------- END SOURCE ----------
      (Review ID: 139700)
      ======================================================================

            nlindenbsunw Norbert Lindenberg (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: