<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Excuse me, but I don't understand anything you are talking about here. Note this channel is for discussion of the Class-File API instead of support questions.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Both classes are inner classes, which are nested classes that are not static. (Refer to JLS section 8.1.3). All constructors of inner classes have a mandated (implicit, but required to be present by specification) argument that passes the immediately enclosing
instance. See JLS section 15.9.2 for determining enclosing instances.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The JLS is available at <a href="https://docs.oracle.com/javase/specs" id="OWAd1af06e5-1815-994f-88ab-097baf09258c" class="OWAAutoLink">
https://docs.oracle.com/javase/specs</a>. You can find the sections in the menu.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In short, both cases will have enclosing instances and an implicit outer-this argument in the constructors because their declarations are not static classes. That is, unless you are declaring as member of interfaces; interface member classes are implicitly
public and static, which does not seem to be your case as you are declaring the first class as private.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If you have more questions, please go to compiler-dev list.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
Regards,</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", 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> Mark Roberts <markro@cs.washington.edu><br>
<b>Sent:</b> Friday, April 25, 2025 4:54 PM<br>
<b>To:</b> classfile-api-dev@openjdk.org <classfile-api-dev@openjdk.org><br>
<b>Cc:</b> Chen Liang <chen.l.liang@oracle.com><br>
<b>Subject:</b> [External] : MethodTypeDesc.parameterList()</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
span.x_EmailStyle25
{font-family:"Calibri",sans-serif;
color:windowtext}
.x_MsoChpDefault
{font-size:10.0pt}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
{}
-->
</style>
<div lang="EN-US" link="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal">There seems to be an inconsistency in the treatment of parameters to inner class constructors. Given that these two classes are inner classes:</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> private class Entry</p>
<p class="x_MsoNormal"> {</p>
<p class="x_MsoNormal"> final double key;</p>
<p class="x_MsoNormal"> final Object value;</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> public Entry(double key, Object value) {</p>
<p class="x_MsoNormal"> this.key = key;</p>
<p class="x_MsoNormal"> this.value = value;</p>
<p class="x_MsoNormal"> }</p>
<p class="x_MsoNormal"> }</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> public class DuplicateElementException extends RuntimeException</p>
<p class="x_MsoNormal"> {</p>
<p class="x_MsoNormal"> DuplicateElementException() { }</p>
<p class="x_MsoNormal"> DuplicateElementException(String s) { super(s); }</p>
<p class="x_MsoNormal"> }</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">For the first, the local vars:</p>
<p class="x_MsoNormal">this, key, value</p>
<p class="x_MsoNormal">Param types:</p>
<p class="x_MsoNormal">MapQuick.PriorityQueue, double, java.lang.Object</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Note that the type of ‘this’ is included in the list – this is not true for every other case I have seen.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">For the second, local vars:</p>
<p class="x_MsoNormal">this, this$0</p>
<p class="x_MsoNormal">Param types:</p>
<p class="x_MsoNormal">MapQuick.PriorityQueue</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">This agrees with the ‘normal’ case as MapQuick.PriorityQueue is associated with ‘this$0’ and the type for ‘this’ is not included.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">I had to add a lot of ugly code to work around this. It seems like including the type of the ‘this’ pointer is a problem or am I missing something?</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Thank you,</p>
<p class="x_MsoNormal">Mark</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
</div>
</div>
</body>
</html>