ObjectMethods seems generating wrong methods for array-type field

Kengo TODA skypencil at gmail.com
Wed Apr 14 09:03:14 UTC 2021

I found that the JLS 16 does not cover the array type record component:

So it could be not a core-lib issue but a JLS issue.

Do I need to forward this thread to another mailing list?
If so, please let me know which is the preferred one.
I've checked https://mail.openjdk.java.net/mailman/listinfo but not so sure.

Thank you very much.

Kengo TODA
skypencil at gmail.com

On Wed, Apr 14, 2021 at 9:04 AM Kengo TODA <skypencil at gmail.com> wrote:

> Hello there,
> I'm Kengo TODA, an engineer learning about the Record feature.
> Today I found a nonintentional behavior, and it seems that the bug
> database has no info about it.
> Let me ask here to confirm it's by-design or not. If it's a bug, I want to
> try to send a patch to OpenJDK.
> Here is the code reproducing the nonintentional behavior:
> https://gist.github.com/KengoTODA/4d7ef6a5226d347ad9385241fee6bc63
> In short, the ObjectMethods class in OpenJDK v16 generates code
> that invokes the fields' method, even when the field is an array.
> Please help me to understand this behavior, or
> make an entry in the bug database to propose a patch.
> Thanks in advance! :)
> ***
> Kengo TODA
> skypencil at gmail.com

More information about the core-libs-dev mailing list