-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
behavioral
-
low
-
JDK
Summary
Emit a waring for silent link failures when {@link}
or {@linkplain}
tags refer to members or types that are not visible under the current Javadoc visibility flag (e.g., a private field when -private
is not enabled).
Problem
Authors may write
/**
* See {@link #privateField} for details.
*/
public void foo() {}
and expect a hyperlink, but if privateField
is private (and -private
isn't specified), javadoc silently renders plain text with no feedback. Author may also accidentaly link to a private field when they intended to link to a public method.
Solution
If the referenced element cannot be linked, emit a warning to alert users about this issue.
Specification
No specification changes are required.
Specification
The proposed text for the warning is:
warning: the specified link will not be shown because the referenced element has access-level "-private" (see -private)
* {@link <ref>} text.
^
- csr of
-
JDK-8139744 Types referred in @link/@linkplain tags are not always hyperlinks
-
- In Progress
-