Skip to content

Commit ca0e165

Browse files
author
emmanue1
committed
Fixed #197 : INTERNAL ERROR
1 parent 3758e39 commit ca0e165

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/util/ByteCodeParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,7 @@ private void parseInvokeDynamic(Statements<Statement> statements, DefaultStack<E
12951295
String name1 = constants.getConstantString(cnat1.getNameIndex());
12961296
String descriptor1 = constants.getConstantString(cnat1.getDescriptorIndex());
12971297

1298-
if (name1.startsWith("lambda$") && (typeName.equals(internalTypeName))) {
1298+
if (typeName.equals(internalTypeName)) {
12991299
for (ClassFileConstructorOrMethodDeclaration methodDeclaration : bodyDeclaration.getMethodDeclarations()) {
13001300
if (((methodDeclaration.getFlags() & (FLAG_SYNTHETIC|FLAG_PRIVATE)) == (FLAG_SYNTHETIC|FLAG_PRIVATE)) && methodDeclaration.getMethod().getName().equals(name1) && methodDeclaration.getMethod().getDescriptor().equals(descriptor1)) {
13011301
// Create lambda expression

src/main/java/org/jd/core/v1/service/converter/classfiletojavasyntax/visitor/CreateInstructionsVisitor.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.jd.core.v1.model.javasyntax.AbstractJavaSyntaxVisitor;
1313
import org.jd.core.v1.model.javasyntax.declaration.*;
1414
import org.jd.core.v1.model.javasyntax.statement.ByteCodeStatement;
15+
import org.jd.core.v1.model.javasyntax.type.ObjectType;
1516
import org.jd.core.v1.model.javasyntax.type.Type;
1617
import org.jd.core.v1.service.converter.classfiletojavasyntax.model.cfg.ControlFlowGraph;
1718
import org.jd.core.v1.service.converter.classfiletojavasyntax.model.javasyntax.declaration.ClassFileBodyDeclaration;
@@ -48,6 +49,15 @@ public void visit(BodyDeclaration declaration) {
4849
for (ClassFileConstructorOrMethodDeclaration method : methods) {
4950
if ((method.getFlags() & FLAG_SYNTHETIC) != 0) {
5051
method.accept(this);
52+
} else if (method.getParameterTypes() != null) {
53+
for (Type type : method.getParameterTypes()) {
54+
if (type.isObject() && ((ObjectType)type).getName() == null) {
55+
// Synthetic type in parameters -> synthetic method
56+
method.setFlags(method.getFlags() | FLAG_SYNTHETIC);
57+
method.accept(this);
58+
break;
59+
}
60+
}
5161
}
5262
}
5363
for (ClassFileConstructorOrMethodDeclaration method : methods) {

0 commit comments

Comments
 (0)