Integrated: 8341904: Search tag in inherited doc comment creates additional index item

Hannes Wallnöfer hannesw at openjdk.org
Tue Nov 12 09:27:32 UTC 2024


On Tue, 29 Oct 2024 14:51:53 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

> Please review a change to avoid generation of index items for comments inherited from overridden methods. This affects `{@index}`, `{@systemProperty}`, and `@spec` tags in both implicitly and explicitly doc comments. 
> 
> The change adds two additional means for avoiding generation of index items which partially overlap:
> 
>  - Adding the `inheritDoc` tag to the current `TagletWriter.Context` when rendering an inherited doc comment
>  - Comparing the element's type element with the type element currently being documented
> 
> The second check is necessary for implicitly inherited doc comments (e.g. overriding a method without doc comment), while usage of `{@inheritDoc}` tag is detected by checks. I still decided to add the `inheritDoc` tag constant to `TagletWriter.Context` since it is explicit, uses a mechanism that was created for the purpose, and might be useful in other places. 
> 
> There was a test case for the previous (buggy) behaviour to add a search tag index item using the overridden method signature as label. I changed the expected behaviour and added another method to cover usage of the `{@systemProperty}` tag in combination with `{@inheritDoc}`.

This pull request has now been integrated.

Changeset: baabfbba
Author:    Hannes Wallnöfer <hannesw at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/baabfbba3e7b5d9c860de38f1f9ed9cd36848f29
Stats:     61 lines in 5 files changed: 31 ins; 15 del; 15 mod

8341904: Search tag in inherited doc comment creates additional index item

Reviewed-by: prappo

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

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


More information about the javadoc-dev mailing list