On Thu, 31 Oct 2024 11:48:27 GMT, Nizar Benalla <nbena...@openjdk.org> wrote:

> Please review this patch to prevent links to private and package-private 
> members to be generated.
> The bug happens when you link to private/package-private members, and javadoc 
> used to generated links to them (assuming they were inherited because the 
> holder is unreachable).
> 
> Taking the code path I changed is very rare, as it only used by 4 anchors in 
> 4 classes in all the JDK.
> 
> if (refSignature.trim().startsWith("#") &&
>                     ! (utils.isPublic(containing) || 
> utils.isLinkable(containing))
> 
> 
> The classes that used it are `StringBuilder`/`StringBuffer` with 
> `#append(java.lang.String)` and `ZipEntry`/`ZipOutputStream` with `#CENHDR`
> 
> 
> I've expanded the test to check whether the links are created when they 
> should be.
> 
> The generated documentation before and after the change are identical.

This pull request has now been integrated.

Changeset: b53ee053
Author:    Nizar Benalla <nbena...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/b53ee053f7f7ffcf02ff47e1895ce7be4bc32486
Stats:     138 lines in 4 files changed: 59 ins; 69 del; 10 mod

8202617: javadoc generates broken links to undocumented (e.g. private) members

Reviewed-by: hannesw

-------------

PR: https://git.openjdk.org/jdk/pull/21802

Reply via email to