-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
minimal
-
JavaDoc will fail to generate documentation for code containing reference tags that use the wrong type.
-
Other
Summary
JavaDoc should not accept member references that use a nested type instead of the type containing the member.
Problem
When linking to a method or field in JavaDoc comments, it is currently possible to use a nested type of the type containing the method or field in the reference tag. Consider the following example:
{@link Map.Entry#put(K, V)}
Although interface Map.Entry
does not have a put
method, the tag is accepted by JavaDoc and creates a link to the put(K, V)
method in the enclosing Map
interface.
Solution
When resolving a reference to a field or method with an explicit type name, JavaDoc should make sure the given type contains the given field or method, otherwise report an error.
The solution should not affect member references where the type name is omitted, which are resolved against the type containing the reference and its enclosing types, if any.
Specification
Honor the type name in JavaDoc method or field references, and report an error if the method or field is not found in the given type.
- csr of
-
JDK-8164094 javadoc allows to create a @link to a non-existent method
-
- Resolved
-