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

stddoclet: Documents inherited nested types that are not actually inherited

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • tools
    • beta2
    • generic, x86
    • generic, windows_98



      Name: boT120536 Date: 01/31/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      The following two compilation units illustrate this bug. According to the JLS,
      the class JavaDocBug does not inherit the nested type X.Inner, since it
      declares a member type of its own that hide it.

      According to the javadoc documentation however, JavaDocBug both declares a
      member type called Inner and inherits a type of the same name from X. This is
      neither accurate from a language point of view nor particularly useful. Such
      idioms are common in certain implementations of the State pattern.

      The correct way for the user to navigate to X.Inner from JavaDocBug is to
      examine JavaDocBug.Inner and then see that its superclass is X.Inner.


      package test.javadocbug2;

      public class X {
          class Inner {
          }
      }

      package test.javadocbug2;

      public class JavaDocBug extends X {
          class Inner extends X.Inner {
          }
      }
      (Review ID: 116027)
      ======================================================================

      Name: boT120536 Date: 03/08/2001


      Overview Package Class Tree Deprecated Index Help
        
       PREV CLASS NEXT CLASS FRAMES NO FRAMES
      SUMMARY: INNER | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

      --------------------------------------------------------------------------------

      package1
      Class Class3
      java.lang.Object
        |
        +--package1.Class1
              |
              +--package2.Class2
                    |
                    +--package1.Class3


      --------------------------------------------------------------------------------

      public class Class3
      extends Class2


      --------------------------------------------------------------------------------

      Constructor Summary
      Class3()
                  
        Method Summary
       void m4()
                  
        Methods inherited from class package2.Class2
      m5
        Methods inherited from class package1.Class1
      m0, m1, m2, m3
        Methods inherited from class java.lang.Object
      , clone, equals, finalize, getClass, hashCode, notify, notifyAll,
      registerNatives, toString, wait, wait, wait
        

      Constructor Detail


      Class3
      public Class3()
      Method Detail

      m4
      public void m4()

      --------------------------------------------------------------------------------
      Overview Package Class Tree Deprecated Index Help
        
       PREV CLASS NEXT CLASS FRAMES NO FRAMES
      SUMMARY: INNER | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

      --------------------------------------------------------------------------------


      Dear sir,
      we have found the following bugs in the javadoc utility.

      Javadoc shows the private members of the superclass being inherited by its
      subclass... and also shows the private methods of superclass which belongs to
      different package. So after Method summary it shows the wrong member list as
      suggested by java documentaions. i.e It shows all the members not inherited by
      the superclass while the meaning of the documentation heading tells a
      different story. The exact problem is... Java documentaion shows methods
      inherited from superclass which is actually not inherited. You can't call that
      method on perticular instance of that class.
      In our example we created two packages called package1 and package2.
      There are two classes in package1 called Class1 and Class3.
      There is one class in package2 called Class2.
      The code is as following.

      In Class3 it shows method m5() inherited from Class2 and method m0() inherited
      from Class1 which both are private method of the coresponding class. But
      actually method m5() and m0() are not inherited from their corresponding
      superclass. And you cannot calles on the instance of Class3.


      package package1;

      public class Class1 {
         private void m0() {}
         void m1() {}
         protected void m2() {}
         public void m3() {}
      }

      package package2;

      public class Class2 extends package1.Class1{

      private void m5(){}
      }

      package package1;

      public class Class3 extends package2.Class2 {
         public void m4(){
            m1();
            m2();
            m3();
         }

      }
      (Review ID: 118375)
      ======================================================================

            jhosunw Jamie Ho (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: