<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Stephan,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I believe the reason javac required Signature attribute was that enum constructors always had 2 leading synthetic name and ordinal parameters, yet they couldn't be marked so until MethodParameters attributes are introduced in 8. And core reflection assumes
 the annotations don't appear on implicit (mandated) or synthetic parameters.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I javap disassembled the eclipse jdt output at <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/205#issuecomment-1960748768" id="OWA71fc9b29-9b17-8526-3610-d122b7ee36eb" class="OWAAutoLink">
Enumerations incompatible with "javac" · Issue #205 · eclipse-jdt/eclipse.jdt.core (github.com)</a>, and found that it emits neither MethodParameters nor Signature attributes on the constructor. Then it makes sense for core reflection and javac to consider
 there's a size mismatch between RuntimeInvisibleParameterAnnotations attribute (3)and the method parameter list (5). I recommend ecj to emit either Signatures (marking synthetic parameters) or MethodParameters to help javac categorize the parameters, and then
 report the problems with javac and core reflection on identification of these parameters.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Chen Liang</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> compiler-dev <compiler-dev-retn@openjdk.org> on behalf of Stephan Herrmann <stephan.herrmann@berlin.de><br>
<b>Sent:</b> Thursday, June 20, 2024 4:42 AM<br>
<b>To:</b> compiler-dev@openjdk.org <compiler-dev@openjdk.org><br>
<b>Subject:</b> javac blames legal class files as "bad class file"</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This is a friendly reminder that <a href="https://bugs.openjdk.org/browse/JDK-8024694">
https://bugs.openjdk.org/browse/JDK-8024694</a> is <br>
still causing grief.<br>
<br>
In particular, Eclipse keeps receiving bug reports because javac claims that <br>
class files created by ecj are "bad".<br>
<br>
Latest analysis indicates that this wrong blame could be the result of an <br>
internal AIOOBE that javac catches and translates into a general, not helpful <br>
error message.<br>
<br>
To be explicit: comments in JDK-8024694 mostly discuss which attributes javac <br>
should emit, which at this point is irrelevant for Eclipse. The original bug is <br>
that javac should not expect all class files to follow the same convention in <br>
situations where JVMS explicitly allows different strategies.<br>
<br>
More details can be found around these reports:<br>
- <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=388314">https://bugs.eclipse.org/bugs/show_bug.cgi?id=388314</a><br>
- <a href="https://github.com/eclipse-jdt/eclipse.jdt.core/issues/205">https://github.com/eclipse-jdt/eclipse.jdt.core/issues/205</a><br>
<br>
regards,<br>
Stephan<br>
</div>
</span></font></div>
</body>
</html>