diff --git a/sootup.core/src/main/java/sootup/core/inputlocation/ClassLoadingOptions.java b/sootup.core/src/main/java/sootup/core/inputlocation/ClassLoadingOptions.java deleted file mode 100644 index c3512ff1d99..00000000000 --- a/sootup.core/src/main/java/sootup/core/inputlocation/ClassLoadingOptions.java +++ /dev/null @@ -1,45 +0,0 @@ -package sootup.core.inputlocation; -/*- - * #%L - * Soot - a J*va Optimization Framework - * %% - * Copyright (C) 2019-2020 Christian Brüggemann - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 2.1 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * . - * #L% - */ -import java.util.List; -import javax.annotation.Nonnull; -import sootup.core.transform.BodyInterceptor; - -/** - * Options that are passed through to the respective frontend. These define how the frontend should - * behave while loading classes. - * - *

Besides being able to create your own by implementing this interface, each frontend has - * built-in sets of options such as {@code java.bytecode.inputlocation.BytecodeClassLoadingOptions} - * and {@code java.sourcecode.inputlocation.SourcecodeClassLoadingOptions} - * - * @author Christian Brüggemann - */ -public interface ClassLoadingOptions { - - /** - * The interceptors are executed in order on each loaded method body, allowing it to be inspected - * and manipulated. - */ - @Nonnull - List getBodyInterceptors(); -} diff --git a/sootup.core/src/main/java/sootup/core/inputlocation/EmptyClassLoadingOptions.java b/sootup.core/src/main/java/sootup/core/inputlocation/EmptyClassLoadingOptions.java deleted file mode 100644 index 3fda3aa8254..00000000000 --- a/sootup.core/src/main/java/sootup/core/inputlocation/EmptyClassLoadingOptions.java +++ /dev/null @@ -1,39 +0,0 @@ -package sootup.core.inputlocation; - -/*- - * #%L - * SootUp - * %% - * Copyright (C) 1997 - 2024 Raja Vallée-Rai and others - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 2.1 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * . - * #L% - */ - -import java.util.Collections; -import java.util.List; -import javax.annotation.Nonnull; -import sootup.core.transform.BodyInterceptor; - -/** @author Markus Schmidt */ -public enum EmptyClassLoadingOptions implements ClassLoadingOptions { - Default { - @Nonnull - @Override - public List getBodyInterceptors() { - return Collections.emptyList(); - } - } -} diff --git a/sootup.java.bytecode/src/main/java/sootup/java/bytecode/inputlocation/BytecodeClassLoadingOptions.java b/sootup.java.bytecode/src/main/java/sootup/java/bytecode/inputlocation/BytecodeClassLoadingOptions.java deleted file mode 100644 index 29c0afca105..00000000000 --- a/sootup.java.bytecode/src/main/java/sootup/java/bytecode/inputlocation/BytecodeClassLoadingOptions.java +++ /dev/null @@ -1,42 +0,0 @@ -package sootup.java.bytecode.inputlocation; -/*- - * #%L - * Soot - a J*va Optimization Framework - * %% - * Copyright (C) 2019-2020 Christian Brüggemann - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 2.1 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * . - * #L% - */ -import java.util.List; -import javax.annotation.Nonnull; -import sootup.core.inputlocation.ClassLoadingOptions; -import sootup.core.transform.BodyInterceptor; -import sootup.java.bytecode.interceptors.BytecodeBodyInterceptors; - -/** - * Built-in sets of {@link ClassLoadingOptions} for the bytecode frontend. - * - * @author Christian Brüggemann - */ -public enum BytecodeClassLoadingOptions implements ClassLoadingOptions { - Default { - @Nonnull - @Override - public List getBodyInterceptors() { - return BytecodeBodyInterceptors.Default.bodyInterceptors(); - } - } -} diff --git a/sootup.java.core/src/main/java/sootup/java/core/views/JavaModuleView.java b/sootup.java.core/src/main/java/sootup/java/core/views/JavaModuleView.java index 6fca0f044b1..bf0187d8523 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/views/JavaModuleView.java +++ b/sootup.java.core/src/main/java/sootup/java/core/views/JavaModuleView.java @@ -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.*; @@ -55,29 +52,11 @@ public JavaModuleView( this(inputLocations, moduleInputLocations, new FullCacheProvider()); } + /** Creates a new instance of the {@link JavaModuleView} class. */ public JavaModuleView( @Nonnull List inputLocations, @Nonnull List 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 null, otherwise the desired - * options. - */ - public JavaModuleView( - @Nonnull List inputLocations, - @Nonnull List moduleInputLocations, - @Nonnull ClassCacheProvider cacheProvider, - @Nonnull Function classLoadingOptionsSpecifier) { super(inputLocations, cacheProvider, JavaModuleIdentifierFactory.getInstance()); this.moduleInfoAnalysisInputLocations = moduleInputLocations; JavaModuleInfo unnamedModuleInfo = JavaModuleInfo.getUnnamedModuleInfo(); @@ -180,7 +159,6 @@ public synchronized Optional getClass( .filter(Optional::isPresent) .limit(1) .map(Optional::get) - .map(src -> (JavaSootClassSource) src) .collect(Collectors.toList()); if (!foundClassSources.isEmpty()) { @@ -208,7 +186,6 @@ public synchronized Optional getClass( .filter(Optional::isPresent) .limit(1) .map(Optional::get) - .map(src -> (JavaSootClassSource) src) .collect(Collectors.toList()); if (!foundClassSources.isEmpty()) { @@ -229,7 +206,6 @@ public synchronized Optional getClass( getAbstractClassSourcesForModules(entryPackage.getModuleSignature(), type) .filter(Optional::isPresent) .map(Optional::get) - .map(src -> (JavaSootClassSource) src) .filter( sc -> { if (targetIsFromSameModule) { diff --git a/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/JavaSourcePathAnalysisInputLocation.java b/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/JavaSourcePathAnalysisInputLocation.java index 4951d9e8a4b..d10f1e4d28d 100644 --- a/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/JavaSourcePathAnalysisInputLocation.java +++ b/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/JavaSourcePathAnalysisInputLocation.java @@ -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; @@ -41,8 +40,6 @@ /** * An implementation of the {@link AnalysisInputLocation} interface for the Java source code path. * - *

Provides default {@link ClassLoadingOptions} from {@link SourcecodeClassLoadingOptions}. - * * @author Linghui Luo */ public class JavaSourcePathAnalysisInputLocation implements AnalysisInputLocation { diff --git a/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/SourcecodeClassLoadingOptions.java b/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/SourcecodeClassLoadingOptions.java deleted file mode 100644 index 522a1a3710e..00000000000 --- a/sootup.java.sourcecode/src/main/java/sootup/java/sourcecode/inputlocation/SourcecodeClassLoadingOptions.java +++ /dev/null @@ -1,42 +0,0 @@ -package sootup.java.sourcecode.inputlocation; -/*- - * #%L - * Soot - a J*va Optimization Framework - * %% - * Copyright (C) 2019-2020 Christian Brüggemann - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 2.1 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * . - * #L% - */ -import java.util.Collections; -import java.util.List; -import javax.annotation.Nonnull; -import sootup.core.inputlocation.ClassLoadingOptions; -import sootup.core.transform.BodyInterceptor; - -/** - * Built-in sets of {@link ClassLoadingOptions} for the sourcecode frontend. - * - * @author Christian Brüggemann - */ -public enum SourcecodeClassLoadingOptions implements ClassLoadingOptions { - Default { - @Nonnull - @Override - public List getBodyInterceptors() { - return Collections.emptyList(); - } - } -}