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

"diamond" interface inheritance causes loss of multiply inherited base class methods

XMLWordPrintable

    • b65
    • generic
    • generic

      If you have an interface inheritance hierarchy like this,
      with Z extending A via two different paths

      A -> B -> C -> Z
      A -> X -> Z

      Then the javadoc for interface Z does not refer to
      the methods defined in A.

      Self-explanatory shell transcript follows:
      (Note how "aMethod" is referred to in
      every .html file *except* Z.html

      $ cat ?.java; echo ------------; javadoc ?.java >/dev/null; grep aMethod ?.html
      public interface A {
          /**
           * aDoc.
           */
          void aMethod();
      }
      public interface B extends A {
          /**
           * bDoc.
           */
          void bMethod();
      }
      public interface C extends B {
          /**
           * cDoc.
           */
          void cMethod();
      }
      public interface X extends A {
          /**
           * xDoc.
           */
          void xMethod();
      }
      public interface Z extends X, C {
          /**
           * zDoc.
           */
          void zMethod();
      }
      ------------
      A.html:<TD><CODE><B><A HREF="A.html#aMethod()">aMethod</A></B>()</CODE>
      A.html:<A NAME="aMethod()"><!-- --></A><H3>
      A.html:aMethod</H3>
      A.html:void <B>aMethod</B>()</PRE>
      B.html:<TD><CODE><A HREF="A.html#aMethod()">aMethod</A></CODE></TD>
      C.html:<TD><CODE><A HREF="A.html#aMethod()">aMethod</A></CODE></TD>
      X.html:<TD><CODE><A HREF="A.html#aMethod()">aMethod</A></CODE></TD>
      ###@###.### 2005-04-15 18:48:05 GMT
      I am currently testing a fix for this. VisibleMemberMap does not handle this case properly.

            jhosunw Jamie Ho (Inactive)
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: