Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
stschott committed Nov 23, 2023
1 parent 5b7eb64 commit cb56161
Show file tree
Hide file tree
Showing 40 changed files with 23 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;
import sootup.java.sourcecode.inputlocation.JavaSourcePathAnalysisInputLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;
import sootup.java.sourcecode.inputlocation.JavaSourcePathAnalysisInputLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import sootup.core.types.ClassType;
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/** @author : Hasitha Rajapakse, Jonas Klauke * */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaJimple;
import sootup.java.core.language.JavaLanguage;

@Category(Java8Test.class)
public class InstantiateClassValueVisitorTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import sootup.core.Language;
import sootup.core.Project;
import sootup.core.inputlocation.AnalysisInputLocation;
import sootup.core.jimple.common.expr.JVirtualInvokeExpr;
Expand All @@ -24,7 +23,6 @@
import sootup.java.core.JavaSootClass;
import sootup.java.core.JavaSootClassSource;
import sootup.java.core.language.JavaJimple;
import sootup.java.core.language.JavaLanguage;
import sootup.java.sourcecode.inputlocation.JavaSourcePathAnalysisInputLocation;
import sootup.jimple.parser.JimpleAnalysisInputLocation;
import sootup.jimple.parser.JimpleProject;
Expand All @@ -38,8 +36,7 @@ public void createSourceCodeProject() {
Path pathToSource = Paths.get("src/test/resources/BasicSetup/source");
AnalysisInputLocation<JavaSootClass> inputLocation =
new JavaSourcePathAnalysisInputLocation(pathToSource.toString());
Project project =
JavaProject.builder().addInputLocation(inputLocation).build();
Project project = JavaProject.builder().addInputLocation(inputLocation).build();
}

@Ignore
Expand All @@ -59,8 +56,7 @@ public void createByteCodeProject() {
PathBasedAnalysisInputLocation.create(pathToBinary, null);

// Create a new JavaProject based on the input location
Project project =
JavaProject.builder().addInputLocation(inputLocation).build();
Project project = JavaProject.builder().addInputLocation(inputLocation).build();

// Create a view for project, which allows us to retrieve classes
View view = project.createView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.JavaSootClassSource;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/** This example illustrates how to invoke body interceptors. */
Expand All @@ -37,7 +36,6 @@ public void test() {
PathBasedAnalysisInputLocation.create(
Paths.get("src/test/resources/BodyInterceptor/binary"), null);


// Create a new JavaProject based on the input location
JavaProject project = JavaProject.builder().addInputLocation(inputLocation).build();
JavaView view = project.createView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

public class CallgraphExample {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import sootup.java.core.JavaSootClassSource;
import sootup.java.core.OverridingJavaClassSource;
import sootup.java.core.language.JavaJimple;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/** InvokeDynamics and the Operand stack.. */
Expand All @@ -22,8 +21,7 @@ public void test() {
AnalysisInputLocation<JavaSootClass> inputLocation =
new JavaClassPathAnalysisInputLocation(directory);

JavaProject project =
JavaProject.builder().addInputLocation(inputLocation).build();
JavaProject project = JavaProject.builder().addInputLocation(inputLocation).build();

JavaView view = project.createView();
Assert.assertEquals(1, view.getClasses().size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

public class RuntimeJarConversionTests {
Expand All @@ -19,8 +18,7 @@ private static void execute(String methodSignature1) {
AnalysisInputLocation<JavaSootClass> inputLocation =
PathBasedAnalysisInputLocation.create(
Paths.get(System.getProperty("java.home") + "/lib/rt.jar"), null);
JavaProject project =
JavaProject.builder().addInputLocation(inputLocation).build();
JavaProject project = JavaProject.builder().addInputLocation(inputLocation).build();

final MethodSignature methodSignature =
JavaIdentifierFactory.getInstance().parseMethodSignature(methodSignature1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

@Category(Java8Test.class)
Expand All @@ -24,8 +23,7 @@ public void test() {
AnalysisInputLocation<JavaSootClass> inputLocation =
new JavaClassPathAnalysisInputLocation(directory);

JavaProject project =
JavaProject.builder().addInputLocation(inputLocation).build();
JavaProject project = JavaProject.builder().addInputLocation(inputLocation).build();

JavaView view = project.createView();
view.configBodyInterceptors((ail) -> EmptyClassLoadingOptions.Default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

@Category(Java8Test.class)
Expand All @@ -28,8 +27,7 @@ public void test() {
AnalysisInputLocation<JavaSootClass> inputLocation =
PathBasedAnalysisInputLocation.create(jar, null);

JavaProject project =
JavaProject.builder().addInputLocation(inputLocation).build();
JavaProject project = JavaProject.builder().addInputLocation(inputLocation).build();

JavaView view =
project.createView(analysisInputLocation -> BytecodeClassLoadingOptions.Default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import sootup.java.core.JavaModuleInfo;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.signatures.ModulePackageName;
import sootup.java.core.types.ModuleJavaClassType;
import sootup.java.core.views.JavaModuleView;
Expand All @@ -28,9 +27,7 @@ public class JavaModuleViewTest {
@Test
public void testGeneralClassReceivalFromModule() {
JavaProject p =
JavaProject.builder()
.addInputLocation(new JrtFileSystemAnalysisInputLocation())
.build();
JavaProject.builder().addInputLocation(new JrtFileSystemAnalysisInputLocation()).build();
JavaModuleView view = (JavaModuleView) p.createView();
ModuleJavaClassType targetClass =
JavaModuleIdentifierFactory.getInstance().getClassType("String", "java.lang", "java.base");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import sootup.java.core.JavaIdentifierFactory;
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/*-
Expand Down Expand Up @@ -59,8 +58,7 @@ protected IdentifierFactory getIdentifierFactory() {
protected void testClassReceival(
AnalysisInputLocation<JavaSootClass> ns, List<ClassType> sigs, int classesFound) {

final JavaProject project =
JavaProject.builder().addInputLocation(ns).build();
final JavaProject project = JavaProject.builder().addInputLocation(ns).build();
final JavaView view = project.createView();

for (ClassType classType : sigs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sootup.core.model.SourceType;
import sootup.core.types.ClassType;
import sootup.java.core.*;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.signatures.ModulePackageName;
import sootup.java.core.signatures.ModuleSignature;
import sootup.java.core.types.JavaClassType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import sootup.core.util.ImmutableUtils;
import sootup.core.views.View;
import sootup.java.core.*;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/**
Expand Down Expand Up @@ -205,11 +204,7 @@ public void testRuntimeJar() {
PathBasedAnalysisInputLocation.create(
Paths.get(System.getProperty("java.home") + "/lib/rt.jar"), null);

JavaView v =
JavaProject.builder()
.addInputLocation(pathBasedNamespace)
.build()
.createView();
JavaView v = JavaProject.builder().addInputLocation(pathBasedNamespace).build().createView();

// test some standard jre classes
runtimeContains(v, "Object", "java.lang");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ public void testIssue739() {
Paths.get("../shared-test-resources/bugfixes/Issue739_Aggregator.class"),
SourceType.Application);

JavaProject project =
JavaProject.builder().addInputLocation(inputLocation).build();
JavaProject project = JavaProject.builder().addInputLocation(inputLocation).build();

JavaView view = project.createView();
view.configBodyInterceptors(a -> BytecodeClassLoadingOptions.Default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import sootup.java.bytecode.inputlocation.JavaClassPathAnalysisInputLocation;
import sootup.java.bytecode.interceptors.typeresolving.types.BottomType;
import sootup.java.core.JavaProject;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/** @author Zun Wang */
Expand Down Expand Up @@ -75,8 +74,7 @@ public void setUp() {
.collect(Collectors.joining(File.pathSeparator));
JavaClassPathAnalysisInputLocation analysisInputLocation =
new JavaClassPathAnalysisInputLocation(jarFile + File.pathSeparator + rtJarClassPath);
JavaProject p =
JavaProject.builder().addInputLocation(analysisInputLocation).build();
JavaProject p = JavaProject.builder().addInputLocation(analysisInputLocation).build();
view = p.createView();
ViewTypeHierarchy typeHierarchy = new ViewTypeHierarchy(view);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.JavaSootMethod;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

public class TypeAssignerTestSuite {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.JavaSootMethod;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.types.JavaClassType;
import sootup.java.core.views.JavaView;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ public JavaProjectBuilder addInputLocation(

@Nonnull
public JavaProjectBuilder addInputLocation(
ModuleInfoAnalysisInputLocation analysisInputLocation) {
ModuleInfoAnalysisInputLocation analysisInputLocation) {
useModules = true;
this.moduleAnalysisInputLocations.add(analysisInputLocation);
return this;
}

@Nonnull
public JavaProjectBuilder addInputLocation(
MultiReleaseModuleInfoAnalysisInputLocation analysisInputLocation) {
MultiReleaseModuleInfoAnalysisInputLocation analysisInputLocation) {
if (analysisInputLocation.getLanguage().getVersion() > 8) {
useModules = true;
this.moduleAnalysisInputLocations.add(analysisInputLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;

import sootup.core.Language;
import sootup.core.frontend.AbstractClassSource;
import sootup.core.inputlocation.AnalysisInputLocation;
import sootup.core.views.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
package sootup.java.core;

import sootup.core.Language;
import sootup.core.frontend.AbstractClassSource;
import sootup.core.inputlocation.AnalysisInputLocation;
import sootup.core.views.View;
import sootup.java.core.signatures.ModuleSignature;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;
import sootup.core.Language;

/**
* @author Markus Schmidt
* <p>Interface to mark AnalysisInputLocations that are capable of retreiving
* JavaModuleInformations
*/
public interface MultiReleaseModuleInfoAnalysisInputLocation extends ModuleInfoAnalysisInputLocation {
public interface MultiReleaseModuleInfoAnalysisInputLocation
extends ModuleInfoAnalysisInputLocation {

@Nonnull
Language getLanguage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import sootup.java.core.JavaProject;
import sootup.java.core.JavaSootClass;
import sootup.java.core.OverridingJavaClassSource;
import sootup.java.core.language.JavaLanguage;
import sootup.java.core.views.JavaView;

/** @author Linghui Luo */
Expand All @@ -38,8 +37,7 @@ public class JFieldRefTest {

@Before
public void setUp() {
JavaProject project =
JavaProject.builder().addInputLocation(new EagerInputLocation()).build();
JavaProject project = JavaProject.builder().addInputLocation(new EagerInputLocation()).build();
view = project.createView();
}

Expand Down
Loading

0 comments on commit cb56161

Please sign in to comment.