JDK-5023741 : getSuperclass returns AbstractStringBuilder instead of Object
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2004-03-30
  • Updated: 2004-10-20
  • Resolved: 2004-10-20
Related Reports
Relates :  
Relates :  
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

Comments
EVALUATION getSuperclass returns the real superclass of StringBuilder, the documentation reports public classes only. ###@###.### 2004-04-08 Current behavior is as expected. Information on the documentation-related aspects of this can be found in the bug reports noted in the "See Also" section. ###@###.### 10/20/04 22:46 GMT
20-10-0004