Skip to content

Commit

Permalink
Use Ipair instead of Pair in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao-senXiong committed Mar 29, 2024
1 parent 13f832c commit eb9a391
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 51 deletions.
3 changes: 0 additions & 3 deletions src/checkers/inference/BaseInferrableChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
import org.checkerframework.framework.flow.CFTransfer;
import org.checkerframework.framework.flow.CFValue;
import org.checkerframework.framework.type.GenericAnnotatedTypeFactory;
import org.checkerframework.javacutil.Pair;
import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import javax.lang.model.element.VariableElement;

import checkers.inference.dataflow.InferenceAnalysis;
import checkers.inference.dataflow.InferenceTransfer;
Expand Down
8 changes: 0 additions & 8 deletions src/checkers/inference/InferenceAnnotatedTypeFactory.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package checkers.inference;

import checkers.inference.model.ConstantSlot;
import checkers.inference.model.Slot;
import com.sun.source.util.TreePath;
import org.checkerframework.common.basetype.BaseAnnotatedTypeFactory;
import org.checkerframework.framework.flow.CFAbstractAnalysis;
import org.checkerframework.framework.flow.CFAnalysis;
Expand All @@ -25,18 +23,14 @@
import org.checkerframework.framework.type.visitor.AnnotatedTypeScanner;
import org.checkerframework.framework.util.AnnotatedTypes;
import org.checkerframework.framework.util.defaults.QualifierDefaults;
import org.checkerframework.framework.util.dependenttypes.DependentTypesHelper;
import org.checkerframework.javacutil.AnnotationBuilder;
import org.checkerframework.javacutil.AnnotationMirrorSet;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.ElementUtils;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.javacutil.TreeUtils;

import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -49,14 +43,12 @@
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.TypeParameterElement;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.type.TypeVariable;

import checkers.inference.dataflow.InferenceAnalysis;
import checkers.inference.model.ConstraintManager;
import checkers.inference.model.Slot;
import checkers.inference.qual.VarAnnot;
import checkers.inference.util.ConstantToVariableAnnotator;
import checkers.inference.util.InferenceUtil;
Expand Down
3 changes: 0 additions & 3 deletions src/checkers/inference/InferrableChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
import org.checkerframework.framework.flow.CFTransfer;
import org.checkerframework.framework.flow.CFValue;
import org.checkerframework.framework.type.GenericAnnotatedTypeFactory;
import org.checkerframework.javacutil.Pair;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Set;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.VariableElement;

import checkers.inference.dataflow.InferenceAnalysis;
import checkers.inference.model.ConstraintManager;
Expand Down
2 changes: 0 additions & 2 deletions src/checkers/inference/VariableAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
import org.checkerframework.framework.type.visitor.AnnotatedTypeScanner;
import org.checkerframework.javacutil.AnnotationBuilder;
import org.checkerframework.javacutil.AnnotationMirrorSet;
import org.checkerframework.javacutil.AnnotationUtils;
import org.checkerframework.javacutil.ElementUtils;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.javacutil.TreePathUtil;
import org.checkerframework.javacutil.TreeUtils;
import org.checkerframework.javacutil.TypesUtils;
Expand Down
5 changes: 0 additions & 5 deletions src/checkers/inference/dataflow/InferenceAnalysis.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package checkers.inference.dataflow;

import java.util.List;
import java.util.Set;
import java.util.logging.Logger;

import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.VariableElement;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;

Expand All @@ -17,7 +13,6 @@
import org.checkerframework.framework.type.GenericAnnotatedTypeFactory;
import org.checkerframework.javacutil.AnnotationMirrorSet;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.Pair;

import checkers.inference.InferenceChecker;
import checkers.inference.InferrableChecker;
Expand Down
1 change: 0 additions & 1 deletion src/checkers/inference/dataflow/InferenceTransfer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.checkerframework.framework.type.AnnotatedTypeMirror;
import org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedTypeVariable;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.Pair;

import java.util.HashMap;
import java.util.Map;
Expand Down
1 change: 0 additions & 1 deletion src/checkers/inference/util/ASTPathUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.checkerframework.framework.type.visitor.AnnotatedTypeScanner;
import org.checkerframework.framework.util.AnnotatedTypes;
import org.checkerframework.javacutil.BugInCF;
import org.checkerframework.javacutil.Pair;

import java.util.IdentityHashMap;
import java.util.logging.Logger;
Expand Down
1 change: 0 additions & 1 deletion src/checkers/inference/util/JaifBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import com.sun.source.tree.Tree;

import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/DataflowInferenceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.List;

import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;

import checkers.inference.test.CFInferenceTest;
Expand All @@ -19,8 +19,8 @@ public DataflowInferenceTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>> of(DataflowSolverEngine.class.getCanonicalName(),
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>> of(DataflowSolverEngine.class.getCanonicalName(),
new ArrayList<String>());
}

Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/IFlowSinkPropTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;
import sparta.checkers.IFlowSinkChecker;
import sparta.checkers.propagation.IFlowSinkSolver;
Expand All @@ -19,8 +19,8 @@ public IFlowSinkPropTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>>of(IFlowSinkSolver.class.getCanonicalName(), new ArrayList<String>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>>of(IFlowSinkSolver.class.getCanonicalName(), new ArrayList<String>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/IFlowSinkSatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;
import sparta.checkers.IFlowSinkChecker;
import sparta.checkers.sat.SinkSolver;
Expand All @@ -19,8 +19,8 @@ public IFlowSinkSatTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>>of(SinkSolver.class.getCanonicalName(), new ArrayList<String>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>>of(SinkSolver.class.getCanonicalName(), new ArrayList<String>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/IFlowSourcePropTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;
import sparta.checkers.IFlowSourceChecker;
import sparta.checkers.propagation.IFlowSourceSolver;
Expand All @@ -19,8 +19,8 @@ public IFlowSourcePropTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>>of(IFlowSourceSolver.class.getCanonicalName(), new ArrayList<String>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>>of(IFlowSourceSolver.class.getCanonicalName(), new ArrayList<String>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/IFlowSourceSatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;
import sparta.checkers.IFlowSourceChecker;
import sparta.checkers.sat.SourceSolver;
Expand All @@ -19,8 +19,8 @@ public IFlowSourceSatTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>>of(SourceSolver.class.getCanonicalName(), new ArrayList<String>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>>of(SourceSolver.class.getCanonicalName(), new ArrayList<String>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/InterningTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import checkers.inference.solver.MaxSat2TypeSolver;
import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;

import java.io.File;
Expand All @@ -18,8 +18,8 @@ public InterningTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>>of(MaxSat2TypeSolver.class.getCanonicalName(), new ArrayList<String>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>>of(MaxSat2TypeSolver.class.getCanonicalName(), new ArrayList<String>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/NninfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import checkers.inference.solver.MaxSat2TypeSolver;
import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;

import java.io.File;
Expand All @@ -18,8 +18,8 @@ public NninfTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.of(MaxSat2TypeSolver.class.getCanonicalName(), new ArrayList<>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.of(MaxSat2TypeSolver.class.getCanonicalName(), new ArrayList<>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/OsTrustedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import checkers.inference.solver.MaxSat2TypeSolver;
import checkers.inference.test.CFInferenceTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.org.plumelib.util.IPair;
import org.junit.runners.Parameterized.Parameters;

import java.io.File;
Expand All @@ -18,8 +18,8 @@ public OsTrustedTest(File testFile) {
}

@Override
public Pair<String, List<String>> getSolverNameAndOptions() {
return Pair.<String, List<String>>of(MaxSat2TypeSolver.class.getCanonicalName(), new ArrayList<String>());
public IPair<String, List<String>> getSolverNameAndOptions() {
return IPair.<String, List<String>>of(MaxSat2TypeSolver.class.getCanonicalName(), new ArrayList<String>());
}

@Parameters
Expand Down
6 changes: 3 additions & 3 deletions tests/checkers/inference/test/CFInferenceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.checkerframework.framework.test.CheckerFrameworkPerFileTest;
import org.checkerframework.framework.test.TestUtilities;
import org.checkerframework.javacutil.Pair;
import org.checkerframework.javacutil.SystemUtil;

import java.io.File;
Expand All @@ -11,6 +10,7 @@

import javax.annotation.processing.AbstractProcessor;

import org.checkerframework.org.plumelib.util.IPair;
import org.checkerframework.org.plumelib.util.SystemPlume;
import org.junit.Test;

Expand All @@ -31,7 +31,7 @@ public boolean useHacks() {
return SystemPlume.getBooleanSystemProperty("use.hacks");
}

public abstract Pair<String, List<String>> getSolverNameAndOptions();
public abstract IPair<String, List<String>> getSolverNameAndOptions();

public List<String> getAdditionalInferenceOptions() {
return new ArrayList<String>();
Expand All @@ -49,7 +49,7 @@ public String getPathToInferenceScript() {
@Test
public void run() {
boolean shouldEmitDebugInfo = TestUtilities.getShouldEmitDebugInfo();
Pair<String, List<String>> solverArgs = getSolverNameAndOptions();
IPair<String, List<String>> solverArgs = getSolverNameAndOptions();

final File testDataDir = new File("testdata");

Expand Down

0 comments on commit eb9a391

Please sign in to comment.