HTMLEditorKit() generates wrong <ol> if more than 51 elements

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 5.0
    • Component/s: client-libs

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

      and

      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Using the JTextPane() class with a HTMLEditorKit(), using a long numbered list with an alphabetical type (<ol type="a">) causes some entries to be generated wrong. All 'z' elements in 2-character prefixes are generated wrong. Specifically:

      a. First list element
      ...
      z. 26th list element
      aa. 27th list element
      ...
      ay. 51st list element
      b'. 52 list element
      ba. 53 list element
      ...

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use the JTextPane() class with an HTMLEditorKit() and setText() an HTML string with a table that contains at least 52 list elements or more and use alphabetic numbering. The 52nd entry will have the wrong alphabetic numbering.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      a. First list element
      ...
      z. 26th list element
      aa. 27th list element
      ...
      ay. 51st list element
      az. 52 list element
      ba. 53 list element
      ...
      ACTUAL -
      a. First list element
      ...
      z. 26th list element
      aa. 27th list element
      ...
      ay. 51st list element
      b'. 52 list element
      ba. 53 list element
      ...

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package com.skyscape.shakespeare;

      import java.awt.*;
      import javax.swing.*;
      import javax.swing.text.html.*;

      public class Test {
          public static void main(String[] args) {
              try {
                  String s = "<ol type=\"a\">";
                  for (int i = 1; i <= 100; i++) {
                      s += "<li>This is list element " + i + "</li>";
                  }
                  s += "</ol>";
                  
                  JTextPane p = new JTextPane();
                  p.setEditorKit(new HTMLEditorKit());
                  p.setPreferredSize(new Dimension(250, 800));
                  p.setText(s);

                  JFrame f = new JFrame();
                  f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  f.add(new JScrollPane(p));
                  f.pack();
                  f.setVisible(true);
              } catch (Throwable t) {
                  t.printStackTrace();
              }
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None that I'm aware of.

            Assignee:
            Peter Zhelezniakov
            Reporter:
            Roger Yeung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: