Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Fixed decompilation of default record methods
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveeclipse committed Jan 14, 2023
1 parent 85ebf8d commit 9fe31d0
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,22 @@ protected void appendDescriptor(StringBuilder buf1, int type, String desc, boole
break;
case METHOD_DESCRIPTOR:
case HANDLE_DESCRIPTOR:
buf1.append("("); //$NON-NLS-1$
Type[] types = Type.getArgumentTypes(desc);
for (int i = 0; i < types.length; ++i) {
if (i > 0) {
buf1.append(", "); //$NON-NLS-1$
if (!desc.startsWith("(")) { //$NON-NLS-1$
// Handle to access record fields
buf1.append(getSimpleName(Type.getType(desc)));
} else {
buf1.append("("); //$NON-NLS-1$
Type[] types = Type.getArgumentTypes(desc);
for (int i = 0; i < types.length; ++i) {
if (i > 0) {
buf1.append(", "); //$NON-NLS-1$
}
buf1.append(getSimpleName(types[i]));
}
buf1.append(getSimpleName(types[i]));
buf1.append(") : "); //$NON-NLS-1$
Type returnType = Type.getReturnType(desc);
buf1.append(getSimpleName(returnType));
}
buf1.append(") : "); //$NON-NLS-1$
Type returnType = Type.getReturnType(desc);
buf1.append(getSimpleName(returnType));
break;
case FIELD_DESCRIPTOR:
if ("T".equals(desc)) { //$NON-NLS-1$
Expand Down Expand Up @@ -534,7 +539,6 @@ public void visitMultiANewArrayInsn(String desc, int dims) {
super.visitMultiANewArrayInsn(desc, dims);
}


@Override
public void visitLineNumber(int line, Label start) {
if (showLines) {
Expand Down

0 comments on commit 9fe31d0

Please sign in to comment.