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

getSuperclass returns AbstractStringBuilder instead of Object

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      Name: rmT116609 Date: 03/30/2004


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

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      When I call the method getSuperClass on the StringBuilder i get a class AbstractStringBuilder instead of object. I also noticed that the AbstractStringBuilder contains methods with a corresponding signature, (see code below). Is the signature of the method changed or does the keyword volatile hide the method.

      package java.lang;

      import java.io.IOException;
      import sun.misc.FloatingDecimal;

      abstract class AbstractStringBuilder
          implements Appendable, CharSequence
      {

      ....


          public AbstractStringBuilder append(CharSequence charsequence)
          {
          }

      ....

          public AbstractStringBuilder append(char c)
          {
          }

      ....

          public volatile Appendable append(char c)
              throws IOException
          {
          }

          public volatile Appendable append(CharSequence charsequence)
              throws IOException
          {
          }
      }


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      StringBuilder.class.getSuperclass()

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would expect the super class of the StringBuilder would be Object as indicated in the documentation
      ACTUAL -
      Super class StringBuilder: class java.lang.AbstractStringBuilder

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
       * TestStringBuilder.java
       *
       * Created on March 30, 2004, 2:34 PM
       */

      import java.lang.StringBuilder;

      /**
       *
       * @author schenk_m
       */
      public class TestStringBuilder {
          
          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              System.out.println("Super class StringBuilder: " +
                      StringBuilder.class.getSuperclass());
          }
          
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 245603)
      ======================================================================
      ###@###.### 10/20/04 22:46 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sseligmasunw Scott Seligman (Inactive)
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: