-
Bug
-
Resolution: Fixed
-
P3
-
None
-
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.
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.