[Soot-list] Creating a callgraph of a SpringBootApplication

15 views
Skip to first unread message

Eric Ortega

unread,
Feb 18, 2021, 8:06:56 PM2/18/21
to soot...@cs.mcgill.ca

Hi all,

 

Is it possible to create a callgraph of the following code?   I am able to compile and execute it with gradle and ‘java -jar’, but have been unable to find a solution using soot 4.2.0 + spark that indicates I’m on the right path to mapping edges across these @Bean/@Autowired annotations.  If anyone has any tips I’d be happy to try them out.

 

 

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import org.springframework.boot.CommandLineRunner;

import org.springframework.boot.SpringApplication;

import org.springframework.context.annotation.Bean;

import org.springframework.context.ApplicationContext;

import org.springframework.stereotype.Component;

 

 

@SpringBootApplication

public class Application

{

    @Autowired

    private InterfaceDef interfaceImpl;

 

    public static void main( final String[] args )

    {

        SpringApplication.run(Application.class, args);

    }

 

    @Bean

    public CommandLineRunner commandLineRunner(ApplicationContext ctx)

    {

        return args ->

        {

            interfaceImpl.func();

        };

    }

 

 

    public interface InterfaceDef

    {

        void func();

    }

 

    @Component(value = "interfaceImpl")

    public class InterfaceImpl implements InterfaceDef

    {

        @Override

        public void func()

        {

            System.out.println( "called InterfaceImpl" );

        }

    }

 

}

 

 

Thanks,

Eric Ortega

Reply all
Reply to author
Forward
0 new messages