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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: