|
|
@ -137,7 +137,9 @@ public class ClassWriter { |
|
|
|
// lambda method
|
|
|
|
// lambda method
|
|
|
|
StructMethod mt = cl.getMethod(node.lambda_information.content_method_key); |
|
|
|
StructMethod mt = cl.getMethod(node.lambda_information.content_method_key); |
|
|
|
MethodWrapper meth = wrapper.getMethodWrapper(mt.getName(), mt.getDescriptor()); |
|
|
|
MethodWrapper meth = wrapper.getMethodWrapper(mt.getName(), mt.getDescriptor()); |
|
|
|
MethodDescriptor md = MethodDescriptor.parseDescriptor(node.lambda_information.method_descriptor); |
|
|
|
|
|
|
|
|
|
|
|
MethodDescriptor md_content = MethodDescriptor.parseDescriptor(node.lambda_information.content_method_descriptor); |
|
|
|
|
|
|
|
MethodDescriptor md_lambda = MethodDescriptor.parseDescriptor(node.lambda_information.method_descriptor); |
|
|
|
|
|
|
|
|
|
|
|
if(!lambda_to_anonymous) { // lambda parameters '() ->'
|
|
|
|
if(!lambda_to_anonymous) { // lambda parameters '() ->'
|
|
|
|
|
|
|
|
|
|
|
@ -146,7 +148,11 @@ public class ClassWriter { |
|
|
|
boolean firstpar = true; |
|
|
|
boolean firstpar = true; |
|
|
|
int index = 1; |
|
|
|
int index = 1; |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<md.params.length;i++) { |
|
|
|
int start_index = md_content.params.length - md_lambda.params.length; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<md_content.params.length;i++) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(i >= start_index) { |
|
|
|
|
|
|
|
|
|
|
|
if(!firstpar) { |
|
|
|
if(!firstpar) { |
|
|
|
buff.append(", "); |
|
|
|
buff.append(", "); |
|
|
@ -156,8 +162,9 @@ public class ClassWriter { |
|
|
|
buff.append(parname==null ? "param"+index : parname); // null iff decompiled with errors
|
|
|
|
buff.append(parname==null ? "param"+index : parname); // null iff decompiled with errors
|
|
|
|
|
|
|
|
|
|
|
|
firstpar = false; |
|
|
|
firstpar = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
index+=md.params[i].stack_size; |
|
|
|
index+=md_content.params[i].stack_size; |
|
|
|
} |
|
|
|
} |
|
|
|
buff.append(") ->"); |
|
|
|
buff.append(") ->"); |
|
|
|
|
|
|
|
|
|
|
@ -588,7 +595,8 @@ public class ClassWriter { |
|
|
|
String indstr = InterpreterUtil.getIndentString(indent); |
|
|
|
String indstr = InterpreterUtil.getIndentString(indent); |
|
|
|
|
|
|
|
|
|
|
|
String method_name = node_lambda.lambda_information.method_name; |
|
|
|
String method_name = node_lambda.lambda_information.method_name; |
|
|
|
MethodDescriptor md = MethodDescriptor.parseDescriptor(node_lambda.lambda_information.method_descriptor); |
|
|
|
MethodDescriptor md_content = MethodDescriptor.parseDescriptor(node_lambda.lambda_information.content_method_descriptor); |
|
|
|
|
|
|
|
MethodDescriptor md_lambda = MethodDescriptor.parseDescriptor(node_lambda.lambda_information.method_descriptor); |
|
|
|
|
|
|
|
|
|
|
|
StringWriter strwriter = new StringWriter(); |
|
|
|
StringWriter strwriter = new StringWriter(); |
|
|
|
BufferedWriter bufstrwriter = new BufferedWriter(strwriter); |
|
|
|
BufferedWriter bufstrwriter = new BufferedWriter(strwriter); |
|
|
@ -602,13 +610,17 @@ public class ClassWriter { |
|
|
|
boolean firstpar = true; |
|
|
|
boolean firstpar = true; |
|
|
|
int index = 1; |
|
|
|
int index = 1; |
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<md.params.length;i++) { |
|
|
|
int start_index = md_content.params.length - md_lambda.params.length; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<md_content.params.length;i++) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(i >= start_index) { |
|
|
|
|
|
|
|
|
|
|
|
if(!firstpar) { |
|
|
|
if(!firstpar) { |
|
|
|
bufstrwriter.write(", "); |
|
|
|
bufstrwriter.write(", "); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
VarType partype = md.params[i].copy(); |
|
|
|
VarType partype = md_content.params[i].copy(); |
|
|
|
|
|
|
|
|
|
|
|
String strpartype = ExprProcessor.getCastTypeName(partype); |
|
|
|
String strpartype = ExprProcessor.getCastTypeName(partype); |
|
|
|
if(ExprProcessor.UNDEFINED_TYPE_STRING.equals(strpartype) && DecompilerContext.getOption(IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT)) { |
|
|
|
if(ExprProcessor.UNDEFINED_TYPE_STRING.equals(strpartype) && DecompilerContext.getOption(IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT)) { |
|
|
@ -622,8 +634,9 @@ public class ClassWriter { |
|
|
|
bufstrwriter.write(parname==null?"param"+index:parname); // null iff decompiled with errors
|
|
|
|
bufstrwriter.write(parname==null?"param"+index:parname); // null iff decompiled with errors
|
|
|
|
|
|
|
|
|
|
|
|
firstpar = false; |
|
|
|
firstpar = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
index+=md.params[i].stack_size; |
|
|
|
index+=md_content.params[i].stack_size; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bufstrwriter.write(")"); |
|
|
|
bufstrwriter.write(")"); |
|
|
|