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

javadoc emits "specified by" clause when class has a method that matches a static interface method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • None
    • tools
    • b148
    • Verified

      If a class implements a method that happens to match a static method defined in an interface that the class implements, javadoc emits a "Specified by" clause in the doc for the method in the class.

      Example:

      ==========
      /**
       * An interface.
       */
      public interface AnInterface {
          /**
           * A static method that performs bar.
           */
          static void bar() {
          }
      }

      /**
       * An implementation of {@code AnInterface}.
       */
      public class SomeClass implements AnInterface {
          /**
           * A static method on ImplementingClass. The javadoc output
           * says "Specified by bar in interface AnInterface" which is
           * incorrect since that is a static method.
           */
          public static void bar() {
          }
      }
      ==========

      In the javadoc output for SomeClass.bar(), there is a "Specified by" clause as if SomeClass.bar() overrides AnInterface.bar(). But since these are static methods, no such overriding exists, and the "specified by" clause should not be present.

            bpatel Bhavesh Patel (Inactive)
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: