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

StringContent default constructor does not match documentation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_06"
      Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
      Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)


      ADDITIONAL OS VERSION INFORMATION :
      Linux <hostname> 2.6.9-42.EL #1 Wed Jul 12 23:16:43 EDT 2006 i686 athlon i386 GNU/Linux



      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Java: jdk-6u6-nb-6_1-linux.sh installed on: Red Hat Enterprise Linux WS release 4 (Nahant Update 4)

      A DESCRIPTION OF THE PROBLEM :
      JavaDoc for default constructor states: "Initial size defaults to 10", but checking length after construction yields: 1.

       http://java.sun.com/javase/6/docs/api/javax/swing/text/StringContent.html

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile code:
                StringContent textPaneContent = new StringContent();
                  System.out.println("StringContent size: " + textPaneContent.length());
      Execute code.
      Read system output.
       

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      StringContent size: 10

      ACTUAL -
      StringContent size: 1

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.text.StringContent;

      public class Foo
      {
          public static void main(String[] args)
          {
              StringContent sc = new StringContent();
              System.out.println("StringContent size: " + sc.length());
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      StringContent sc = new StringContent(10);

        Attachments

          Activity

            People

            • Assignee:
              rupashka Pavel Porvatov (Inactive)
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: