<div dir="ltr">I can still reproduce the issue on JDK 22 and 23 EA, I re-opened the bug.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 24, 2024 at 4:49 AM Remi Forax <<a href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"><div><br></div><div><br></div><hr id="m_-108559604624193744zwchr"><div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><b>From: </b>"Patrick Doyle" <<a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a>><br><b>To: </b>"Liam Miller-Cushon" <<a href="mailto:cushon@google.com" target="_blank">cushon@google.com</a>><br><b>Cc: </b>"Archie Cobbs" <<a href="mailto:archie.cobbs@gmail.com" target="_blank">archie.cobbs@gmail.com</a>>, "amber-dev" <<a href="mailto:amber-dev@openjdk.org" target="_blank">amber-dev@openjdk.org</a>><br><b>Sent: </b>Wednesday, April 24, 2024 12:53:52 PM<br><b>Subject: </b>Re: Bug: Compact record constructor is missing generic type info on parameters<br></blockquote></div><div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div>Thanks, Liam. Perhaps Java 22 doesn't use the "mandated" flag anymore? Oracle has closed by bug as "not a bug": <a href="https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8331026" target="_blank">https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-8331026</a><br></div><br><div>> The observations on Windows 11:<br>> JDK 22: Passed all tests.<br>> Close as not an issue.</div><br><div>Given that Gradle doesn't support Java 22 yet, this is a bit tricky for me to try at the moment. I know when I build it with Java 21 and then run it with 22, it still fails, but based on the observations from Oracle, I assume it would pass if I compiled the class with Java 22.</div></div></blockquote><div><br></div><div>gradle 8.7 supports Java 22<br></div><div><a href="https://docs.gradle.org/current/release-notes.html#support-for-building-projects-with-java-22" target="_blank">https://docs.gradle.org/current/release-notes.html#support-for-building-projects-with-java-22</a><br></div><div><br></div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div><br></div><br><div>Question: would it make sense to back-port the fix from Java 22 to the LTS versions (17 and 21)? If so, who do I contact about that?<br></div><br><div>Thanks again,<br></div>--<div><div><div dir="ltr" class="gmail_signature">Patrick Doyle<br><a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a><br></div></div></div></div></blockquote><div><br></div><div>regards,<br></div><div>Rémi<br></div><div><br></div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 23, 2024 at 3:51 PM Liam Miller-Cushon <<a href="mailto:cushon@google.com" target="_blank">cushon@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The only noteworthy difference in the class file for the record with the compact constructor is that the parameter has the 'mandated' flag set.<br></div><br><div>I think the behaviour is due to <a href="https://github.com/openjdk/jdk/blob/09b88098ff544fec1a4e94bfbbdc21b6c8433abb/src/java.base/share/classes/java/lang/reflect/Executable.java#L344-L345" target="_blank">this logic</a> in Executable#getAllGenericParameterTypes (which is used by Parameter#getParameterizedType):<br></div><br><div><div>// If we hit a synthetic or mandated parameter,<br>// use the non generic parameter info.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 23, 2024 at 12:47 PM Patrick Doyle <<a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks, Archie. I've submitted the bug report to <a href="http://bugs.java.com" target="_blank">bugs.java.com</a>.<br clear="all"><div><div><div dir="ltr" class="gmail_signature">--<br>Patrick Doyle<br><a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a><br></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 23, 2024 at 3:29 PM Archie Cobbs <<a href="mailto:archie.cobbs@gmail.com" target="_blank">archie.cobbs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Patrick,</div><br><div>If it's just a normal bug, file it at <a href="https://bugs.java.com/bugdatabase/" target="_blank">https://bugs.java.com/bugdatabase/</a> and it will eventually get triaged over to <a href="https://bugs.openjdk.org/" target="_blank">https://bugs.openjdk.org/</a><br></div><br><div>If it's a language question, e.g., a suggestion for some minor improvement, this list would be appropriate.</div><br><div>-Archie<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 23, 2024 at 1:38 PM Patrick Doyle <<a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><br><div>Is this the wrong place to report bugs like this? What would be the right place?</div><br><div>Thanks,<br></div><div><div><div dir="ltr" class="gmail_signature">--<br>Patrick Doyle<br><a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a><br></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 19, 2024 at 8:52 AM Patrick Doyle <<a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><br><div>I have a JUnit5 test case that demonstrates that if you use the compact constructor syntax in a record, the reflection info will be missing generic type information. Implicit constructors work fine, as do explicit canonical constructors.<br></div><br><div>I found this on Temurin 21.0.2 and the Adoptium project suggested I post here.</div><br><div>The unit test can be found in the Adoptium bug report: <a href="https://github.com/adoptium/adoptium-support/issues/1025" target="_blank">https://github.com/adoptium/adoptium-support/issues/1025</a><br></div><br><div>Let me know if there's anything I can do to help.<br></div><br>Thanks,<br>--<div><div><div dir="ltr" class="gmail_signature">Patrick Doyle<br><a href="mailto:p.r.doyle@gmail.com" target="_blank">p.r.doyle@gmail.com</a><br></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div>
</blockquote></div>
</blockquote></div>
</blockquote></div><br></blockquote></div></div></div></blockquote></div>