This commit is contained in:
Julian Dolby 2017-03-19 08:18:25 -04:00
commit eca53cd0c2
43 changed files with 91 additions and 55 deletions

View File

@ -20,8 +20,6 @@ import com.ibm.wala.util.NullProgressMonitor;
import com.ibm.wala.util.ProgressMaster;
import com.ibm.wala.util.WalaException;
import junit.framework.AssertionFailedError;
public abstract class AbstractFieldBasedTest extends TestJSCallGraphShape {
protected FieldBasedCGUtil util;
@ -48,8 +46,8 @@ public abstract class AbstractFieldBasedTest extends TestJSCallGraphShape {
cg = util.buildCG(url, builderType, monitor, false, DefaultSourceExtractor.factory).fst;
System.err.println(cg);
verifyGraphAssertions(cg, assertions);
} catch(AssertionFailedError afe) {
throw new AssertionFailedError(builderType + ": " + afe.getMessage());
} catch(AssertionError afe) {
throw new AssertionError(builderType + ": " + afe.getMessage());
}
}
return cg;

View File

@ -11,8 +11,6 @@ import com.ibm.wala.cast.js.test.TestSimplePageCallGraphShape;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.WalaException;
import junit.framework.AssertionFailedError;
public class FieldBasedComparisonTest extends AbstractFieldBasedTest {
private void test(String file, Object[][] assertions, BuilderType builderType) throws IOException, WalaException, Error, CancelException {
@ -25,7 +23,7 @@ public class FieldBasedComparisonTest extends AbstractFieldBasedTest {
}
}
@Test(expected = AssertionFailedError.class)
@Test(expected = AssertionError.class)
public void testSkeletonPessimistic() throws IOException, WalaException, Error, CancelException {
test("pages/skeleton.html", TestSimplePageCallGraphShape.assertionsForSkeleton, BuilderType.PESSIMISTIC);
}
@ -40,7 +38,7 @@ public class FieldBasedComparisonTest extends AbstractFieldBasedTest {
test("pages/skeleton.html", TestSimplePageCallGraphShape.assertionsForSkeleton, BuilderType.OPTIMISTIC_WORKLIST);
}
@Test(expected = AssertionFailedError.class)
@Test(expected = AssertionError.class)
public void testSkeleton2Pessimistic() throws IOException, WalaException, Error, CancelException {
test("pages/skeleton2.html", TestSimplePageCallGraphShape.assertionsForSkeleton2, BuilderType.PESSIMISTIC);
}

View File

@ -17,6 +17,8 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;
import org.junit.Assert;
import com.ibm.wala.cast.js.html.DefaultSourceExtractor;
import com.ibm.wala.cast.js.html.JSSourceExtractor;
import com.ibm.wala.cast.js.ipa.callgraph.JSCFABuilder;
@ -38,8 +40,6 @@ import com.ibm.wala.util.io.CommandLine;
import com.ibm.wala.util.io.FileProvider;
import com.ibm.wala.util.io.FileUtil;
import junit.framework.Assert;
/**
* Utility class for building call graphs of HTML pages.
*

View File

@ -1020,6 +1020,7 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
processCallingConstraintsInternal(this, caller, instruction, target, constParams, uniqueCatchKey);
}
@SuppressWarnings("unused")
public static void processCallingConstraintsInternal(AstSSAPropagationCallGraphBuilder builder, CGNode caller, SSAAbstractInvokeInstruction instruction, CGNode target,
InstanceKey[][] constParams, PointerKey uniqueCatchKey) {

View File

@ -86,6 +86,7 @@ public class CorrelationFinder {
this.translatorFactory = translatorFactory;
}
@SuppressWarnings("unused")
public static CorrelationSummary findCorrelatedAccesses(IMethod method, IR ir) {
AstMethod astMethod = (AstMethod)method;
DefUse du = new DefUse(ir);

View File

@ -16,6 +16,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import com.ibm.wala.cast.tree.CAstNode;
@ -25,8 +26,6 @@ import com.ibm.wala.cast.util.CAstPattern.Segments;
import com.ibm.wala.cast.util.CAstPrinter;
import com.ibm.wala.core.tests.util.WalaTestCase;
import junit.framework.Assert;
public class TestCAstPattern extends WalaTestCase {
private static final int NAME_ASSERTION_SINGLE = 501;

View File

@ -18,6 +18,8 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.junit.Assert;
import com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil;
import com.ibm.wala.cast.ir.ssa.AstIRFactory;
import com.ibm.wala.cast.loader.SingleClassLoaderFactory;
@ -36,8 +38,6 @@ import com.ibm.wala.ssa.SSAOptions;
import com.ibm.wala.util.collections.HashMapFactory;
import com.ibm.wala.util.collections.Pair;
import junit.framework.Assert;
public abstract class TestCAstTranslator extends WalaTestCase {
protected static class TranslatorAssertions {

View File

@ -13,6 +13,8 @@ package com.ibm.wala.cast.test;
import java.util.Collection;
import java.util.Iterator;
import org.junit.Assert;
import com.ibm.wala.cast.loader.AstMethod;
import com.ibm.wala.cast.tree.CAstSourcePositionMap.Position;
import com.ibm.wala.classLoader.CallSiteReference;
@ -24,8 +26,6 @@ import com.ibm.wala.ssa.SSACFG;
import com.ibm.wala.ssa.SSAInstruction;
import com.ibm.wala.util.collections.NonNullSingletonIterator;
import junit.framework.Assert;
public abstract class TestCallGraphShape extends WalaTestCase {
protected void verifyCFGAssertions(CallGraph CG, Object[][] assertionData) {

View File

@ -12,6 +12,7 @@ package com.ibm.wala.core.tests.cha;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
import com.ibm.wala.core.tests.util.TestConstants;
@ -22,8 +23,6 @@ import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.io.FileProvider;
import com.ibm.wala.util.strings.StringStuff;
import junit.framework.Assert;
public class ExclusionsTest {
@Test

View File

@ -14,6 +14,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import com.ibm.wala.cfg.CFGSanitizer;
@ -37,8 +38,6 @@ import com.ibm.wala.util.config.AnalysisScopeReader;
import com.ibm.wala.util.graph.Graph;
import com.ibm.wala.util.io.FileProvider;
import junit.framework.Assert;
/**
* Test integrity of CFGs
*/

View File

@ -12,6 +12,7 @@ package com.ibm.wala.core.tests.ptrs;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
@ -38,8 +39,6 @@ import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.CancelException;
import com.ibm.wala.util.intset.OrdinalSet;
import junit.framework.Assert;
public class ZeroLengthArrayTest {
@Test

View File

@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@ -54,8 +55,6 @@ import com.ibm.wala.util.config.FileOfClasses;
import com.ibm.wala.util.intset.IntIterator;
import com.ibm.wala.util.intset.IntSet;
import junit.framework.Assert;
/**
* Tests of various flow analysis engines.
*/

View File

@ -13,6 +13,8 @@ package com.ibm.wala.examples.analysis.dataflow;
import java.io.IOException;
import org.junit.Assert;
import com.ibm.wala.classLoader.IClass;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.util.TestConstants;
@ -38,8 +40,6 @@ import com.ibm.wala.util.intset.IntIterator;
import com.ibm.wala.util.intset.IntSet;
import com.ibm.wala.util.io.FileProvider;
import junit.framework.Assert;
public class InitializerTest {
/**

View File

@ -93,6 +93,7 @@ public class ClassLoaderImpl implements IClassLoader {
* @param parent parent loader for delegation
* @param exclusions set of classes to exclude from loading
*/
@SuppressWarnings("unused")
public ClassLoaderImpl(ClassLoaderReference loader, ArrayClassLoader arrayClassLoader, IClassLoader parent,
SetOfClasses exclusions, IClassHierarchy cha) {
@ -118,6 +119,7 @@ public class ClassLoaderImpl implements IClassLoader {
* @return the Set of source files in the module
* @throws IOException
*/
@SuppressWarnings("unused")
private Set<ModuleEntry> getSourceFiles(Module M) throws IOException {
if (DEBUG_LEVEL > 0) {
System.err.println("Get source files for " + M);
@ -147,6 +149,7 @@ public class ClassLoaderImpl implements IClassLoader {
* @return the Set of class Files in the module
* @throws IOException
*/
@SuppressWarnings("unused")
private Set<ModuleEntry> getClassFiles(Module M) throws IOException {
if (DEBUG_LEVEL > 0) {
System.err.println("Get class files for " + M);
@ -238,6 +241,7 @@ public class ClassLoaderImpl implements IClassLoader {
/**
* Set up the set of classes loaded by this object.
*/
@SuppressWarnings("unused")
private void loadAllClasses(Collection<ModuleEntry> moduleEntries, Map<String, Object> fileContents) {
for (Iterator<ModuleEntry> it = moduleEntries.iterator(); it.hasNext();) {
ModuleEntry entry = it.next();
@ -406,6 +410,7 @@ public class ClassLoaderImpl implements IClassLoader {
/**
* Set up mapping from type name to Module Entry
*/
@SuppressWarnings("unused")
protected void loadAllSources(Set<ModuleEntry> sourceModules) {
for (Iterator<ModuleEntry> it = sourceModules.iterator(); it.hasNext();) {
ModuleEntry entry = it.next();
@ -474,6 +479,7 @@ public class ClassLoaderImpl implements IClassLoader {
*
* @throws IllegalArgumentException if modules is null
*/
@SuppressWarnings("unused")
@Override
public void init(List<Module> modules) throws IOException {
@ -586,6 +592,7 @@ public class ClassLoaderImpl implements IClassLoader {
/*
* @see com.ibm.wala.classLoader.IClassLoader#lookupClass(com.ibm.wala.types.TypeName)
*/
@SuppressWarnings("unused")
@Override
public IClass lookupClass(TypeName className) {
if (className == null) {
@ -691,6 +698,7 @@ public class ClassLoaderImpl implements IClassLoader {
/*
* @see com.ibm.wala.classLoader.IClassLoader#removeAll(java.util.Collection)
*/
@SuppressWarnings("unused")
@Override
public void removeAll(Collection<IClass> toRemove) {
if (toRemove == null) {

View File

@ -92,6 +92,7 @@ public class BackwardsSupergraph<T, P> implements ISupergraph<T, P> {
*
* @see com.ibm.wala.dataflow.IFDS.ISupergraph#getCalledNodes(java.lang.Object)
*/
@SuppressWarnings("unused")
@Override
public Iterator<T> getCalledNodes(T ret) {
if (DEBUG_LEVEL > 1) {

View File

@ -53,6 +53,7 @@ public class CallFlowEdges {
* @param d1 source fact at the call edge
* @param d2 result fact (result of the call flow function)
*/
@SuppressWarnings("unused")
public void addCallEdge(int c, int d1, int d2) {
if (TabulationSolver.DEBUG_LEVEL > 0) {
System.err.println("addCallEdge " + c + " " + d1 + " " + d2);
@ -80,6 +81,7 @@ public class CallFlowEdges {
* @param d2
* @return set of d1 s.t. {@literal <c, d1> -> <s_p, d2>} was recorded as call flow, or null if none found.
*/
@SuppressWarnings("unused")
public IntSet getCallFlowSources(int c, int d2) {
if (c < 0) {
throw new IllegalArgumentException("invalid c : " + c);
@ -121,6 +123,7 @@ public class CallFlowEdges {
* @param d2
* @return set of c s.t. {@literal <c, d1> -> <s_p, d2>} was recorded as call flow (for some d1), or null if none found.
*/
@SuppressWarnings("unused")
public IntSet getCallFlowSourceNodes(int d2) {
IntSet s = identityEdges.get(d2);
IBinaryNaturalRelation R = edges.get(d2);

View File

@ -99,6 +99,7 @@ public class LocalPathEdges {
*
* @param j
*/
@SuppressWarnings("unused")
public void addPathEdge(int i, int n, int j) {
if (i == 0) {
@ -137,6 +138,7 @@ public class LocalPathEdges {
*
* @param n local block number of the basic block n
*/
@SuppressWarnings("unused")
private void addIdentityPathEdge(int i, int n) {
BitVectorIntSet s = (BitVectorIntSet) identityPaths.get(i);
if (s == null) {
@ -167,6 +169,7 @@ public class LocalPathEdges {
*
* @param j
*/
@SuppressWarnings("unused")
private void addZeroPathEdge(int n, int j) {
BitVectorIntSet z = (BitVectorIntSet) zeroPaths.get(j);

View File

@ -241,6 +241,7 @@ public class TabulationSolver<T, P, F> {
*
* @throws CancelException
*/
@SuppressWarnings("unused")
private void forwardTabulateSLRPs() throws CancelException {
assert curPathEdge == null : "curPathEdge should not be non-null here";
if (worklist == null) {
@ -326,6 +327,7 @@ public class TabulationSolver<T, P, F> {
*
* @param edge
*/
@SuppressWarnings("unused")
private void processNormal(final PathEdge<T> edge) {
if (DEBUG_LEVEL > 0) {
System.err.println("process normal: " + edge);
@ -358,6 +360,7 @@ public class TabulationSolver<T, P, F> {
* Note that we've changed the way we record summary edges. Summary edges are now associated with a callee (s_p,exit), where the
* original algorithm used a call, return pair in the caller.
*/
@SuppressWarnings("unused")
protected void processExit(final PathEdge<T> edge) {
if (DEBUG_LEVEL > 0) {
System.err.println("process exit: " + edge);
@ -399,6 +402,7 @@ public class TabulationSolver<T, P, F> {
* @param c a call site of edge.s_p
* @param D4 set of d1 s.t. {@literal <c, d1> -> <edge.s_p, edge.d2>} was recorded as call flow
*/
@SuppressWarnings("unused")
private void propagateToReturnSites(final PathEdge<T> edge, final T c, final IntSet D4) {
P proc = supergraph.getProcOf(c);
final T[] entries = supergraph.getEntriesForProcedure(proc);
@ -483,6 +487,7 @@ public class TabulationSolver<T, P, F> {
private void propToReturnSite(final T c, final T[] entries, final T retSite, final int d4, final IntSet D5, final PathEdge<T> edge) {
if (D5 != null) {
D5.foreach(new IntSetAction() {
@SuppressWarnings("unused")
@Override
public void act(final int d5) {
// [26 - 28]
@ -537,6 +542,7 @@ public class TabulationSolver<T, P, F> {
/**
* Handle lines [14 - 19] of the algorithm, propagating information into and across a call site.
*/
@SuppressWarnings({ "unused", "unused" })
protected void processCall(final PathEdge<T> edge) {
if (DEBUG_LEVEL > 0) {
System.err.println("process call: " + edge);
@ -618,6 +624,7 @@ public class TabulationSolver<T, P, F> {
* @param allReturnSites a set collecting return sites for the call. This set is mutated with the return sites for this callee.
* @param calleeEntry the entry node of the callee in question
*/
@SuppressWarnings("unused")
protected void processParticularCallee(final PathEdge<T> edge, final int callNodeNum, Collection<T> allReturnSites, final T calleeEntry) {
if (DEBUG_LEVEL > 0) {
System.err.println(" process callee: " + calleeEntry);
@ -738,6 +745,7 @@ public class TabulationSolver<T, P, F> {
* @return f(call_d, exit_d);
*
*/
@SuppressWarnings("unused")
protected IntSet computeBinaryFlow(int call_d, int exit_d, IBinaryReturnFlowFunction f) {
if (DEBUG_LEVEL > 0) {
System.err.println("got binary flow function " + f);
@ -750,6 +758,7 @@ public class TabulationSolver<T, P, F> {
* @return f(d1)
*
*/
@SuppressWarnings("unused")
protected IntSet computeFlow(int d1, IUnaryFlowFunction f) {
if (DEBUG_LEVEL > 0) {
System.err.println("got flow function " + f);
@ -792,6 +801,7 @@ public class TabulationSolver<T, P, F> {
* @param n reached block
* @param j dataflow fact reached
*/
@SuppressWarnings("unused")
protected boolean propagate(T s_p, int i, T n, int j) {
int number = supergraph.getLocalBlockNumber(n);
if (number < 0) {
@ -849,6 +859,7 @@ public class TabulationSolver<T, P, F> {
}
}
@SuppressWarnings("unused")
protected void addToWorkList(T s_p, int i, T n, int j) {
if (worklist == null) {
worklist = makeWorklist();

View File

@ -876,6 +876,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
// }));
}
@SuppressWarnings("unused")
protected boolean addAllToP2Set(Map<PointerKeyAndState, MutableIntSet> p2setMap, PointerKeyAndState pkAndState, IntSet vals,
IFlowLabel label) {
final PointerKey pk = pkAndState.getPointerKey();

View File

@ -100,6 +100,7 @@ public class SimpleMemoryAccessMap implements MemoryAccessMap {
}
}
@SuppressWarnings("unused")
private void populate(CGNode n) {
// we analyze bytecodes to avoid the cost of IR construction, except
// for synthetic methods, where we must use the synthetic IR

View File

@ -213,6 +213,7 @@ public class AnalysisScope {
/**
* Add a jar file to the scope for a loader
*/
@SuppressWarnings("unused")
public void addToScope(ClassLoaderReference loader, JarFile file) {
List<Module> s = MapUtil.findOrCreateList(moduleMap, loader);
if (DEBUG_LEVEL > 0) {
@ -224,6 +225,7 @@ public class AnalysisScope {
/**
* Add a module to the scope for a loader
*/
@SuppressWarnings("unused")
public void addToScope(ClassLoaderReference loader, Module m) {
if (m == null) {
throw new IllegalArgumentException("null m");
@ -252,6 +254,7 @@ public class AnalysisScope {
/**
* Add a module file to the scope for a loader. The classes in the added jar file will override classes added to the scope so far.
*/
@SuppressWarnings("unused")
public void addToScopeHead(ClassLoaderReference loader, Module m) {
if (m == null) {
throw new IllegalArgumentException("null m");

View File

@ -110,6 +110,7 @@ public class CHACallGraph extends BasicCallGraph<CHAContextInterpreter> {
setInterpreter(new ContextInsensitiveCHAContextInterpreter());
}
@SuppressWarnings("deprecation")
public void init(Iterable<Entrypoint> entrypoints) throws CancelException {
super.init();
@ -213,6 +214,7 @@ public class CHACallGraph extends BasicCallGraph<CHAContextInterpreter> {
private int clinitPC = 0;
@Override
@SuppressWarnings("deprecation")
public CGNode findOrCreateNode(IMethod method, Context C) throws CancelException {
assert C.equals(Everywhere.EVERYWHERE);
assert !method.isAbstract();

View File

@ -1393,6 +1393,7 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
* @param klass a class
* @return an int set which represents the subset of S that correspond to subtypes of klass
*/
@SuppressWarnings("unused")
protected IntSet filterForClass(IntSet S, IClass klass) {
MutableIntSet filter = null;
if (klass.getReference().equals(TypeReference.JavaLangObject)) {

View File

@ -283,12 +283,8 @@ public class PropagationSystem extends DefaultFixedPointSolver<PointsToSetVariab
pk = key;
}
FilteredPointerKey fpk = (FilteredPointerKey) pk;
if (fpk == null) {
Assertions.UNREACHABLE("fpk is null");
}
if (key == null) {
Assertions.UNREACHABLE("key is null");
}
assert fpk != null;
assert key != null;
if (fpk.getTypeFilter() == null) {
Assertions.UNREACHABLE("fpk.getTypeFilter() is null");
}

View File

@ -364,6 +364,7 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
* @param exceptionVar PointerKey representing a pointer to an exception value
* @param catchClasses the types "caught" by the exceptionVar
*/
@SuppressWarnings("unused")
private void addExceptionDefConstraints(IRView ir, DefUse du, CGNode node, List<ProgramCounter> peis, PointerKey exceptionVar,
Set<IClass> catchClasses) {
if (DEBUG) {
@ -1599,6 +1600,7 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
processCallingConstraints(caller, instruction, target, constParams, uniqueCatchKey);
}
@SuppressWarnings("unused")
protected void processCallingConstraints(CGNode caller, SSAAbstractInvokeInstruction instruction, CGNode target,
InstanceKey[][] constParams, PointerKey uniqueCatchKey) {
// TODO: i'd like to enable this optimization, but it's a little tricky

View File

@ -116,6 +116,7 @@ public class BasicRTABuilder extends AbstractRTABuilder {
*/
final private MutableIntSet previousReceivers = IntSetUtil.getDefaultIntSetFactory().make();
@SuppressWarnings("unused")
@Override
public byte evaluate(PointsToSetVariable lhs, PointsToSetVariable rhs) {
IntSetVariable receivers = rhs;

View File

@ -145,6 +145,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
*
* @param n
*/
@SuppressWarnings("unused")
private void addIntraproceduralNodesAndEdgesForCGNodeIfNeeded(CGNode n) {
if (!cgNodesVisited.contains(cg.getNumber(n)) && relevant.test(n)) {
if (DEBUG_LEVEL > 0) {
@ -175,6 +176,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
* @param instrs the instructions for node n
* @param bb a basic block in the CFG
*/
@SuppressWarnings("unused")
protected void addEdgesToNonEntryBlock(CGNode n, ControlFlowGraph<?, T> cfg, SSAInstruction[] instrs, T bb) {
if (DEBUG_LEVEL > 1) {
System.err.println("addEdgesToNonEntryBlock: " + bb);
@ -233,6 +235,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
* @param returnBlock the return site for a call
* @param targetCFG the called method
*/
@SuppressWarnings("unused")
private void addEdgesFromExitToReturn(CGNode caller, T returnBlock, CGNode target,
ControlFlowGraph<SSAInstruction, ? extends T> targetCFG) {
T texit = targetCFG.exit();
@ -255,6 +258,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
* @param callBlock the return site for a call
* @param targetCFG the called method
*/
@SuppressWarnings("unused")
private void addEdgesFromCallToEntry(CGNode caller, T callBlock, CGNode target,
ControlFlowGraph<SSAInstruction, ? extends T> targetCFG) {
T tentry = targetCFG.entry();
@ -277,6 +281,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
* @param n a node in the call graph
* @param bb the entry() block for n
*/
@SuppressWarnings("unused")
private void addInterproceduralEdgesForEntryAndExitBlocks(CGNode n, ControlFlowGraph<SSAInstruction, ? extends T> cfg) {
T entryBlock = cfg.entry();
@ -296,6 +301,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
}
}
@SuppressWarnings("unused")
private void addEntryAndExitEdgesToCaller(CGNode n, T entryBlock, T exitBlock, CGNode caller) {
if (DEBUG_LEVEL > 0) {
System.err.println("caller " + caller + "is relevant");
@ -344,6 +350,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
*
* @param cfg a control-flow graph
*/
@SuppressWarnings("unused")
private void addNodeForEachBasicBlock(ControlFlowGraph<? extends SSAInstruction, ? extends T> cfg, CGNode N) {
for (Iterator<? extends T> bbs = cfg.iterator(); bbs.hasNext();) {
T bb = bbs.next();
@ -481,6 +488,7 @@ public abstract class AbstractInterproceduralCFG<T extends ISSABasicBlock> imple
/**
* add edges to callee entry for call block, and edges from callee exit to corresponding return blocks
*/
@SuppressWarnings("unused")
private void addCalleeEdgesForCall(CGNode n, BasicBlockInContext<T> callBlock) {
int num = g.getNumber(callBlock);
if (!handledCalls.contains(num)) {

View File

@ -83,6 +83,7 @@ public class SummarizedMethodWithNames extends SummarizedMethod {
if (DEBUG) { System.err.println("From old MSUM"); }
}
@SuppressWarnings("unused")
public SummarizedMethodWithNames(MethodReference ref, VolatileMethodSummary summary, IClass declaringClass)
throws NullPointerException {
super(ref, summary.getMethodSummary(), declaringClass);

View File

@ -54,6 +54,7 @@ public abstract class UTF8Convert {
* @returns unicode string
* @throws IllegalArgumentException if utf8 is null
*/
@SuppressWarnings("unused")
public static String fromUTF8(byte[] utf8) throws UTFDataFormatException {
if (utf8 == null) {
throw new IllegalArgumentException("utf8 is null");

View File

@ -130,4 +130,4 @@ public class DexIContextInterpreter implements SSAContextInterpreter {
IR ir = getIR(n);
return ir.getControlFlowGraph();
}
};
}

View File

@ -395,7 +395,7 @@ public class DexIMethod implements IBytecodeMethod {
* @see com.ibm.wala.classLoader.IMethod#hasExceptionHandler()
*/
public boolean hasExceptionHandler() {
TryItem[] tries = eMethod.codeItem.getTries();;
TryItem[] tries = eMethod.codeItem.getTries();
return tries==null?false:tries.length > 0;
}

View File

@ -147,7 +147,8 @@ public class WDexClassLoaderImpl extends ClassLoaderImpl {
}
private void loadAllDexClasses(Collection<ModuleEntry> moduleEntries) {
@SuppressWarnings("unused")
private void loadAllDexClasses(Collection<ModuleEntry> moduleEntries) {
for (Iterator<ModuleEntry> it = moduleEntries.iterator(); it.hasNext();) {
ModuleEntry entry = it.next();

View File

@ -55,7 +55,7 @@ import com.ibm.wala.types.TypeReference;
public class ArrayGet extends Instruction {
public enum Type{t_int,t_wide,t_boolean,t_byte,t_char, t_object, t_short};
public enum Type{t_int,t_wide,t_boolean,t_byte,t_char, t_object, t_short}
public final int destination;
public final int array;

View File

@ -65,7 +65,7 @@ public class BinaryLiteralOperation extends Instruction {
ADD_INT,RSUB_INT,MUL_INT,DIV_INT,REM_INT,AND_INT,OR_INT,XOR_INT,SHL_INT,SHR_INT,USHR_INT,
ADD_LONG,RSUB_LONG,MUL_LONG,DIV_LONG,REM_LONG,AND_LONG,OR_LONG,XOR_LONG,SHL_LONG,SHR_LONG,USHR_LONG,
ADD_FLOAT,RSUB_FLOAT,MUL_FLOAT,DIV_FLOAT,REM_FLOAT,
ADD_DOUBLE,RSUB_DOUBLE,MUL_DOUBLE,DIV_DOUBLE,REM_DOUBLE};
ADD_DOUBLE,RSUB_DOUBLE,MUL_DOUBLE,DIV_DOUBLE,REM_DOUBLE}
public final OpID op;
public final int oper1;

View File

@ -64,7 +64,7 @@ public class BinaryOperation extends Instruction {
ADD_INT,SUB_INT,MUL_INT,DIV_INT,REM_INT,AND_INT,OR_INT,XOR_INT,SHL_INT,SHR_INT,USHR_INT,
ADD_LONG,SUB_LONG,MUL_LONG,DIV_LONG,REM_LONG,AND_LONG,OR_LONG,XOR_LONG,SHL_LONG,SHR_LONG,USHR_LONG,
ADD_FLOAT,SUB_FLOAT,MUL_FLOAT,DIV_FLOAT,REM_FLOAT,
ADD_DOUBLE,SUB_DOUBLE,MUL_DOUBLE,DIV_DOUBLE,REM_DOUBLE};
ADD_DOUBLE,SUB_DOUBLE,MUL_DOUBLE,DIV_DOUBLE,REM_DOUBLE}
public final OpID op;
public final int oper1;

View File

@ -68,7 +68,7 @@ public abstract class Branch extends Instruction {
public static class UnaryBranch extends Branch
{
public enum CompareOp {EQZ,NEZ,LTZ,LEZ,GTZ,GEZ};
public enum CompareOp {EQZ,NEZ,LTZ,LEZ,GTZ,GEZ}
public final int oper1;
public final CompareOp op;
@ -103,7 +103,7 @@ public abstract class Branch extends Instruction {
public static class BinaryBranch extends Branch
{
public enum CompareOp {EQ,NE,LT,LE,GT,GE};
public enum CompareOp {EQ,NE,LT,LE,GT,GE}
public final int oper1;
public final int oper2;
public final CompareOp op;

View File

@ -58,7 +58,7 @@ import com.ibm.wala.util.debug.Assertions;
public class UnaryOperation extends Instruction {
public static enum OpID {MOVE, MOVE_WIDE, MOVE_EXCEPTION, NOT, NEGINT, NOTINT, NEGLONG, NOTLONG, NEGFLOAT, NEGDOUBLE, DOUBLETOLONG, DOUBLETOFLOAT, INTTOBYTE, INTTOCHAR, INTTOSHORT, DOUBLETOINT, FLOATTODOUBLE, FLOATTOLONG, FLOATTOINT, LONGTODOUBLE, LONGTOFLOAT, LONGTOINT, INTTODOUBLE, INTTOFLOAT, INTTOLONG};
public static enum OpID {MOVE, MOVE_WIDE, MOVE_EXCEPTION, NOT, NEGINT, NOTINT, NEGLONG, NOTLONG, NEGFLOAT, NEGDOUBLE, DOUBLETOLONG, DOUBLETOFLOAT, INTTOBYTE, INTTOCHAR, INTTOSHORT, DOUBLETOINT, FLOATTODOUBLE, FLOATTOLONG, FLOATTOINT, LONGTODOUBLE, LONGTOFLOAT, LONGTOINT, INTTODOUBLE, INTTOFLOAT, INTTOLONG}
public final OpID op;
public final int source;

View File

@ -205,7 +205,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterAT_FIRST(int PC) { return PC; };
protected int enterAT_FIRST(int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.BEFORE_LOOP got stepped over.
@ -219,7 +219,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterBEFORE_LOOP (int PC) { return PC; };
protected int enterBEFORE_LOOP (int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.START_OF_LOOP got stepped over.
@ -233,7 +233,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterSTART_OF_LOOP (int PC) { return PC; };
protected int enterSTART_OF_LOOP (int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.MIDDLE_OF_LOOP got stepped over.
@ -247,7 +247,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterMIDDLE_OF_LOOP (int PC) { return PC; };
protected int enterMIDDLE_OF_LOOP (int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.MULTIPLE_TIMES_IN_LOOP got stepped over.
@ -261,7 +261,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterMULTIPLE_TIMES_IN_LOOP (int PC) { return PC; };
protected int enterMULTIPLE_TIMES_IN_LOOP (int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.END_OF_LOOP got stepped over.
@ -275,7 +275,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterEND_OF_LOOP (int PC) { return PC; };
protected int enterEND_OF_LOOP (int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.AFTER_LOOP got stepped over.
@ -289,7 +289,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterAFTER_LOOP (int PC) { return PC; };
protected int enterAFTER_LOOP (int PC) { return PC; }
/**
* Gets called when Label ExecutionOrder.AT_LAST got stepped over.
@ -303,7 +303,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int enterAT_LAST (int PC) { return PC; };
protected int enterAT_LAST (int PC) { return PC; }
/**
* Gets called when the model gets finished.
@ -317,7 +317,7 @@ public abstract class AbstractAndroidModel {
* you'll simply pass body.getNextProgramCounter()
* @return Program Counter after insertion of the code
*/
protected int leaveAT_LAST (int PC) { return PC; };
protected int leaveAT_LAST (int PC) { return PC; }
/**
* Dispatches to the enterLABEL-functions. Does also call functions to any labels that

View File

@ -90,7 +90,7 @@ public class Intent implements ContextItem, Comparable<Intent> {
BROADCAST,
/** Do not handle intent */
IGNORE
};
}
private enum Explicit {
UNSET,

View File

@ -134,7 +134,7 @@ public class AndroidManifestXMLReader {
public Set<Tag> getSubTags();
}
private interface HistoryKey {} ;
private interface HistoryKey {}
/**
* Only includes relevant tags.
*/

View File

@ -16,6 +16,7 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.junit.Assert;
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
@ -29,8 +30,6 @@ import com.ibm.wala.ipa.callgraph.propagation.InstanceKey;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.util.io.TemporaryFile;
import junit.framework.Assert;
public abstract class JDTJavaTest extends IRTests {
static {

View File

@ -578,6 +578,7 @@ public class JdtUtil {
}
public static ASTNode getAST(IFile javaSourceFile) {
@SuppressWarnings("deprecation")
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(JavaCore.createCompilationUnitFrom(javaSourceFile));
parser.setProject(JavaCore.create(javaSourceFile.getProject()));

View File

@ -126,7 +126,6 @@ public abstract class EclipseProjectPath<E, P> {
}
public EclipseProjectPath create(IProject project) throws CoreException, IOException {
assert project != null;
if (project == null) {
throw new IllegalArgumentException("null project");
}