Skip to content

Commit b990669

Browse files
committed
Ignore lambdas whose target interfaces have multiple methods
This currently accounts for those with default methods, and those which re-declare as abstract methods inherited from Object, such as equals(Object). In the future we should distinguish and disregard these methods as candidates for the intended lambda method.
1 parent 4f9129b commit b990669

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

jbmc/src/java_bytecode/lambda_synthesis.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ void create_invokedynamic_synthetic_classes(
134134
<< messaget::eom;
135135
continue;
136136
}
137+
else if(implemented_interface_type.methods().size() != 1)
138+
{
139+
log.debug() << "ignoring invokedynamic at " << method_identifier
140+
<< " address " << instruction.address
141+
<< " which produces type "
142+
<< implemented_interface_tag.get_identifier()
143+
<< " which should have exactly one abstract method but "
144+
<< " actually has "
145+
<< implemented_interface_type.methods().size()
146+
<< ". Note default methods are not supported yet."
147+
<< messaget::eom;
148+
continue;
149+
}
137150

138151
log.debug() << "identified invokedynamic at " << method_identifier
139152
<< " address " << instruction.address

0 commit comments

Comments
 (0)