0

Im trying to get control flow graph of methods of my code . It working fine for all methods until I ask it to analyse a method which has lambda expression like the below one.

public void test()
    {
        List<String> test = new ArrayList<String>();
        test.forEach((action)->{
            System.out.println(action);
        });

    }

The exception Im getting while I try to invoke Body body = method.retrieveActiveBody(); is

java.lang.RuntimeException: Failed to convert <combin.Line: void test()>
    at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2040)
    at soot.SootMethod.retrieveActiveBody(SootMethod.java:402)

Caused by: java.lang.RuntimeException: No method java.lang.Boolean valueOf(boolean) in class java.lang.Boolean
    at soot.SootClass.getMethod(SootClass.java:412)
    at soot.LambdaMetaFactory$Wrapper.<init>(LambdaMetaFactory.java:285)
    at soot.LambdaMetaFactory.<init>(LambdaMetaFactory.java:63)
    at soot.Singletons.soot_LambdaMetaFactory(Singletons.java:2408)
    at soot.LambdaMetaFactory.v(LambdaMetaFactory.java:67)
    at soot.asm.AsmMethodSource.convertInvokeDynamicInsn(AsmMethodSource.java:1420)
    at soot.asm.AsmMethodSource.convert(AsmMethodSource.java:1791)
    at soot.asm.AsmMethodSource.getBody(AsmMethodSource.java:2038)
    ... 8 more 

The soot version Im using is

compile group:'ca.mcgill.sable', name: 'soot' , version:'3.3.0'

2 Answers2

1

Found the solution for this . Java library classes were not analysed by soot

Its working after I invoke " Options.v().set_prepend_classpath(true); " before setting my soot class path

0

This looks like a bug in Soot. Can you please try the latest version of Soot? If the bug then still shows up, it would be great if you could file a bug report on Github.

Eric
  • 1,343
  • 1
  • 11
  • 19