RFR: 8332039: Cannot invoke "com.sun.source.util.DocTreePath.getTreePath()" because "path" is null
Jonathan Gibbons
jjg at openjdk.org
Fri May 31 21:01:01 UTC 2024
On Fri, 31 May 2024 09:20:27 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
>> I understand the solution and see how it logically parallels the existing link between `getDocTreePath` and inheritable taglets. That said, I dislike the solution, but also cannot propose a better one at this time. The logic is repeated and spread out.
>
>> @pavelrappo raises an interesting point. nested classes do not "inherit" from their enclosing class, and so putting the fix in a method dealing with inheritance seems wrong.
>>
>> Either the fix should be moved or the method renamed.
>
> To clarify, I'm not too concerned with how we call an action whereby a nested class gets its `@since` tag from the enclosing class; but yes, "inheritance" might not be ideal. What I'm concerned with is the fact that the logic originally provided in [`getDefaultBlockTags`][getDefaultBlockTags] is now duplicated in `getInheritedDocTreePath`.
>
> Like I said, while it's bad, the new duplication merely replicates the one we already have between `InheritableTaglet.inherit` and `getInheritedDocTreePath`.
>
> [getDefaultBlockTags]: https://github.com/openjdk/jdk/blob/6ee8407758c92d32e18642b0758d2d5c71ad09f5/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SimpleTaglet.java#L141-L147
> > @pavelrappo raises an interesting point. nested classes do not "inherit" from their enclosing class, and so putting the fix in a method dealing with inheritance seems wrong.
> > Either the fix should be moved or the method renamed.
>
> To clarify, I'm not too concerned with how we call an action whereby a nested class gets its `@since` tag from the enclosing class; but yes, "inheritance" might not be ideal. What I'm concerned with is the fact that the logic originally provided in [`getDefaultBlockTags`](https://github.com/openjdk/jdk/blob/6ee8407758c92d32e18642b0758d2d5c71ad09f5/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SimpleTaglet.java#L141-L147) is now duplicated in `getInheritedDocTreePath`.
>
> Like I said, while it's bad, the new duplication merely replicates the one we already have between `InheritableTaglet.inherit` and `getInheritedDocTreePath`.
If we can't fix this in the next few days, we should file a cleanup issue to resolve this duplication.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19363#issuecomment-2142969145
More information about the javadoc-dev
mailing list