All Downloads are FREE. Search and download functionalities are using the official Maven repository.

soot.jimple.infoflow.solver.gcSolver.OnDemandReferenceProvider Maven / Gradle / Ivy

package soot.jimple.infoflow.solver.gcSolver;

import java.util.Set;

import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;

import heros.SynchronizedBy;
import heros.solver.IDESolver;
import soot.SootMethod;
import soot.jimple.infoflow.solver.fastSolver.FastSolverLinkedNode;
import soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG;

/**
 * Implementation of a reference provider that computes transitive dependency
 * sets on demand
 * 
 * @author Steven Arzt
 *
 * @param 
 * @param 
 */
public class OnDemandReferenceProvider extends AbstractReferenceProvider {

	@SynchronizedBy("by use of synchronized LoadingCache class")
	protected final LoadingCache> methodToReferences = IDESolver.DEFAULT_CACHE_BUILDER
			.build(new CacheLoader>() {

				@Override
				public Set load(SootMethod key) throws Exception {
					return getTransitiveCallees(key);
				}

			});

	public OnDemandReferenceProvider(BiDiInterproceduralCFG icfg) {
		super(icfg);
	}

	@Override
	public Set getMethodReferences(SootMethod method, FastSolverLinkedNode context) {
		return methodToReferences.getUnchecked(method);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy