File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
utbot-framework/src/main/kotlin/org/utbot/engine Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -647,7 +647,14 @@ class Resolver(
647
647
648
648
val declaringClass = classLoader.loadClass(sootClass.name.substringBeforeLast(" \$ lambda" ))
649
649
650
- // TODO: add comments describing the format of Soot class name for lambdas, because here we transform it into the actual synthetic method name
650
+ // Java compiles lambdas into synthetic methods with specific names.
651
+ // However, Soot represents lambdas as classes.
652
+ // Names of these classes are the modified names of these synthetic methods.
653
+ // Specifically, Soot replaces some `$` signs by `_`, adds two underscores and some number
654
+ // to the end of the synthetic method name to form the name of a SootClass for lambda.
655
+ // For example, given a synthetic method `lambda$foo$1` (lambda declared in method `foo` of class `org.utbot.MyClass`),
656
+ // Soot will treat this lambda as a class named `org.utbot.MyClass$lambda_foo_1__5` (the last number is probably arbitrary, it's not important).
657
+ // Here we obtain the synthetic method name of lambda from the name of its SootClass.
651
658
val lambdaName = sootClass.name
652
659
.let { name ->
653
660
val start = name.lastIndexOf(" \$ lambda" ) + 1
You can’t perform that action at this time.
0 commit comments