Elements#getDocComment returns null for record components

Josiah Noel josiahnoel at gmail.com
Thu Apr 4 13:41:37 UTC 2024


I see, so it's a feature rather than a bug. It still seems like a bit of a
hassle that we have to parse the params from the top record Javadoc and
manually associate it by name to a record component element.

On Thu, Apr 4, 2024 at 4:17 AM Petr Portnov <mrjarviscraft at gmail.com> wrote:

> Aren't the comments on records only available via `@param componentName`
> on the type?
>
> чт, 4 апр. 2024 г., 01:31 Josiah Noel <josiahnoel at gmail.com>:
>
>> I have created a simple project that reproduces the issue: SentryMan/record-javadoc-APT-bug
>> (github.com) <https://github.com/SentryMan/record-javadoc-APT-bug>
>>
>> On Tue, Apr 2, 2024 at 2:55 PM Josiah Noel <josiahnoel at gmail.com> wrote:
>>
>>> Hello there,
>>>
>>> It seems that when I try to read the Javadoc for record components with
>>> my annotation processor, I get null. When I convert the record into a
>>> regular class it works as expected.
>>> --
>>> Cheers, Josiah.
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20240404/e057a494/attachment.htm>


More information about the compiler-dev mailing list