JDK-8317731 : When -parameters are not used, the inner class carries unexpected information
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 21,22
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2023-10-08
  • Updated: 2023-11-20
  • Resolved: 2023-11-20
Related Reports
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
test4.MethodParamInnerClassTest$InnerClass(test4.MethodParamInnerClassTest);
    descriptor: (Ltest4/MethodParamInnerClassTest;)V
    flags: (0x0000)
    Code:
      stack=1, locals=2, args_size=2
         0: aload_0
         1: invokespecial #1                  // Method java/lang/Object."<init>":()V
         4: return
      LineNumberTable:
        line 5: 0
    MethodParameters:
      Name                           Flags
      <no name>                      final mandated


When -parameters are not used, there is a `MethodParameters` here.


REGRESSION : Last worked in version 21


FREQUENCY : always



Comments
As [~darcy] noted, this is intentional change done under JDK-8292275.
20-11-2023

Tested on Windows 11 x64: javac Java21InnerClassWithoutParameters.java javap -v '.\Java21InnerClassWithoutParameters$InnerClass.class' .... <more javap output> .... { Java21InnerClassWithoutParameters$InnerClass(Java21InnerClassWithoutParameters); descriptor: (LJava21InnerClassWithoutParameters;)V flags: (0x0000) Code: stack=1, locals=2, args_size=2 0: aload_0 1: invokespecial #1 // Method java/lang/Object."<init>":()V 4: return LineNumberTable: line 2: 0 MethodParameters: Name Flags <no name> final mandated ... <more javap output> .... Observations: JDK 8 : No `MethodParameters` in the output JDK 11: No `MethodParameters` in the output JDK 17: No `MethodParameters` in the output JDK 21: `MethodParameters` present in the output Open JDK 22: `MethodParameters` present in the output This is a regression issue
31-10-2023

The observed behavioral difference is likely a consequence of JDK-8292275 and this bug will likely be closed as "not an issue."
31-10-2023

Additional Information from submitter: =========================== public class Java21InnerClassWithoutParameters { class InnerClass implements Runnable { public void run() { } } } javac Java21InnerClassWithoutParameters.java
10-10-2023

Requested the submitter to provide a simple reproducer.
09-10-2023