soot-oss / soot

Soot - A Java optimization framework
GNU Lesser General Public License v2.1
2.85k stars 706 forks source link

added reset methods to Scene and SourceLocator to load multiple sources into one Scene and Concrete Native Methods #2015

Closed lukaswd closed 7 months ago

lukaswd commented 10 months ago

These two methods allow for subsequent calls of loadNecessaryClasses().

With that it is possible, if the two methods are called before the next loadNecessaryClasses() method call, to load multiple sources into the same Soot Scene.

Example code to load two programs into the same Soot Scene:

// Options setting for the first source here

Scene.v().loadNecessaryClasses();

// Options setting for the second source here

SourceLocator.v().resetCaches();
Scene.v().resetSootClassPathCache();
Scene.v().setResolving(false);

Scene.v().loadNecessaryClasses();
StevenArzt commented 7 months ago

@lukaswd The code style check failed. Please have a look and fix the code accordingly.