Skip to content

Commit

Permalink
refactor: remove ClassLoadingOptions -> helps simplifiying specificat…
Browse files Browse the repository at this point in the history
…ion of Interceptors
  • Loading branch information
swissiety committed Feb 8, 2024
1 parent 84b98b6 commit 78bae3c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 196 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@
*/

import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nonnull;
import sootup.core.cache.provider.ClassCacheProvider;
import sootup.core.cache.provider.FullCacheProvider;
import sootup.core.inputlocation.AnalysisInputLocation;
import sootup.core.inputlocation.ClassLoadingOptions;
import sootup.core.inputlocation.EmptyClassLoadingOptions;
import sootup.core.signatures.PackageName;
import sootup.core.types.ClassType;
import sootup.java.core.*;
Expand All @@ -55,29 +52,11 @@ public JavaModuleView(
this(inputLocations, moduleInputLocations, new FullCacheProvider());
}

/** Creates a new instance of the {@link JavaModuleView} class. */
public JavaModuleView(
@Nonnull List<AnalysisInputLocation> inputLocations,
@Nonnull List<ModuleInfoAnalysisInputLocation> moduleInputLocations,
@Nonnull ClassCacheProvider cacheProvider) {
this(
inputLocations,
moduleInputLocations,
cacheProvider,
analysisInputLocation -> EmptyClassLoadingOptions.Default);
}

/**
* Creates a new instance of the {@link JavaModuleView} class.
*
* @param classLoadingOptionsSpecifier To use the default {@link ClassLoadingOptions} for an
* {@link AnalysisInputLocation}, simply return <code>null</code>, otherwise the desired
* options.
*/
public JavaModuleView(
@Nonnull List<AnalysisInputLocation> inputLocations,
@Nonnull List<ModuleInfoAnalysisInputLocation> moduleInputLocations,
@Nonnull ClassCacheProvider cacheProvider,
@Nonnull Function<AnalysisInputLocation, ClassLoadingOptions> classLoadingOptionsSpecifier) {
super(inputLocations, cacheProvider, JavaModuleIdentifierFactory.getInstance());
this.moduleInfoAnalysisInputLocations = moduleInputLocations;
JavaModuleInfo unnamedModuleInfo = JavaModuleInfo.getUnnamedModuleInfo();
Expand Down Expand Up @@ -180,7 +159,6 @@ public synchronized Optional<JavaSootClass> getClass(
.filter(Optional::isPresent)
.limit(1)
.map(Optional::get)
.map(src -> (JavaSootClassSource) src)
.collect(Collectors.toList());

if (!foundClassSources.isEmpty()) {
Expand Down Expand Up @@ -208,7 +186,6 @@ public synchronized Optional<JavaSootClass> getClass(
.filter(Optional::isPresent)
.limit(1)
.map(Optional::get)
.map(src -> (JavaSootClassSource) src)
.collect(Collectors.toList());

if (!foundClassSources.isEmpty()) {
Expand All @@ -229,7 +206,6 @@ public synchronized Optional<JavaSootClass> getClass(
getAbstractClassSourcesForModules(entryPackage.getModuleSignature(), type)
.filter(Optional::isPresent)
.map(Optional::get)
.map(src -> (JavaSootClassSource) src)
.filter(
sc -> {
if (targetIsFromSameModule) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.slf4j.LoggerFactory;
import sootup.core.frontend.ResolveException;
import sootup.core.inputlocation.AnalysisInputLocation;
import sootup.core.inputlocation.ClassLoadingOptions;
import sootup.core.model.SourceType;
import sootup.core.transform.BodyInterceptor;
import sootup.core.types.ClassType;
Expand All @@ -41,8 +40,6 @@
/**
* An implementation of the {@link AnalysisInputLocation} interface for the Java source code path.
*
* <p>Provides default {@link ClassLoadingOptions} from {@link SourcecodeClassLoadingOptions}.
*
* @author Linghui Luo
*/
public class JavaSourcePathAnalysisInputLocation implements AnalysisInputLocation {
Expand Down

This file was deleted.

0 comments on commit 78bae3c

Please sign in to comment.