RFR: 8254622: Hide superclasses from conditionally exported packages [v2]

Hannes Wallnöfer hannesw at openjdk.org
Tue Apr 8 09:07:27 UTC 2025


On Sat, 5 Apr 2025 00:35:35 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Hannes Wallnöfer has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review feedback: add Utils.isVisible(TypeElement) method
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Signatures.java line 165:
> 
>> 163:                     for (TypeMirror type : interfaces) {
>> 164:                         TypeElement tDoc = utils.asTypeElement(type);
>> 165:                         if (!(utils.isPublic(tDoc) || utils.isLinkable(tDoc)) || utils.isHidden(tDoc)) {
> 
> This `(!isPublicOrProtected && !isLinkable) || isHidden` trio appears a few times. The conditions are negated and wrapped in parentheses so it is easily confusing on the web; can we extract this check into a new utils method?

That's a very good suggestion. In 682e1eb I added a new `Utils.isVisible(TypeElement)` method which returns true if the argument is not hidden and either public or (externally or internally) linkable. 

I found a few places that only had the public/linkable part but should also have the hidden check (`LinkTaglet` and `AbstractTreeWriter`). I updated these places to use the new method and enhanced `TestHiddenTag` to cover these cases.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24446#discussion_r2032742066


More information about the javadoc-dev mailing list