diff --git a/com.ibm.wala.cast.java.test.data/src/Monitor2.java b/com.ibm.wala.cast.java.test.data/src/Monitor2.java index 9c57540e8..ce0e70d00 100644 --- a/com.ibm.wala.cast.java.test.data/src/Monitor2.java +++ b/com.ibm.wala.cast.java.test.data/src/Monitor2.java @@ -15,10 +15,6 @@ public class Monitor2 { public void incr() { synchronized(this) { i++; } } - private static boolean test(Object o) { - return true; - } - public static void main(String[] a) { new Monitor2().incr(); } diff --git a/com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/FieldBasedCallGraphBuilder.java b/com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/FieldBasedCallGraphBuilder.java index dc4c0fb1d..0b8cfabde 100644 --- a/com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/FieldBasedCallGraphBuilder.java +++ b/com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/FieldBasedCallGraphBuilder.java @@ -274,13 +274,6 @@ public abstract class FieldBasedCallGraphBuilder { return flowGraph.getReachingSet(functionParam, monitor); } - private OrdinalSet getConstructorTargets(FlowGraph flowGraph, CallVertex callVertex, IProgressMonitor monitor) throws CancelException { - SSAAbstractInvokeInstruction invoke = callVertex.getInstruction(); - assert invoke.getDeclaredTarget().getName().equals(JavaScriptMethods.ctorAtom); - VarVertex objectParam = flowGraph.getVertexFactory().makeVarVertex(callVertex.getCaller(), invoke.getUse(0)); - return flowGraph.getReachingSet(objectParam, monitor); - } - /** * Extract call edges from the flow graph into high-level representation. */ diff --git a/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java b/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java index 9b8b96cbc..3ab83e1d6 100644 --- a/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java +++ b/com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java @@ -742,13 +742,6 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa } } - private boolean isEqual(Object a, Object b) { - if (a == null) - return b == null; - else - return a.equals(b); - } - private Set discoveredUpwardFunargs = HashSetFactory.make(); /** diff --git a/com.ibm.wala.core/src/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java b/com.ibm.wala.core/src/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java index f573e138e..67fd8589e 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java +++ b/com.ibm.wala.core/src/com/ibm/wala/demandpa/util/SimpleMemoryAccessMap.java @@ -239,10 +239,6 @@ public class SimpleMemoryAccessMap implements MemoryAccessMap { this.node = node; } - protected int getInstructionIndex() { - return instructionIndex; - } - protected void setInstructionIndex(int instructionIndex) { this.instructionIndex = instructionIndex; } diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java index 8eb4ffab3..7a6b8e9ec 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/SSAPropagationCallGraphBuilder.java @@ -1892,73 +1892,6 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap */ } - private void handleAllReceivers(MutableIntSet receiverVals, InstanceKey[] keys, MutableBoolean sideEffect) { - assert keys[0] == null; - IntIterator receiverIter = receiverVals.intIterator(); - while (receiverIter.hasNext()) { - final int rcvr = receiverIter.next(); - keys[0] = system.getInstanceKey(rcvr); - if (clone2Assign) { - // for efficiency: assume that only call sites that reference - // clone() might dispatch to clone methods - if (call.getCallSite().getDeclaredTarget().getSelector().equals(cloneSelector)) { - IClass recv = (keys[0] != null) ? keys[0].getConcreteType() : null; - IMethod targetMethod = getOptions().getMethodTargetSelector().getCalleeTarget(node, call.getCallSite(), recv); - if (targetMethod != null && targetMethod.getReference().equals(CloneInterpreter.CLONE)) { - // treat this call to clone as an assignment - PointerKey result = getPointerKeyForLocal(node, call.getDef()); - PointerKey receiver = getPointerKeyForLocal(node, call.getReceiver()); - system.newConstraint(result, assignOperator, receiver); - return; - } - } - } - CGNode target = getTargetForCall(node, call.getCallSite(), keys[0].getConcreteType(), keys); - if (target == null) { - // This indicates an error; I sure hope getTargetForCall - // raised a warning about this! - if (DEBUG) { - System.err.println("Warning: null target for call " + call); - } - } else { - IntSet targets = getCallGraph().getPossibleTargetNumbers(node, call.getCallSite()); - // even if we've seen this target before, if we have constant - // parameters, we may need to re-process the call, as the constraints - // for the first time we reached this target may not have been fully - // general. TODO a more refined check? - if (targets != null && targets.contains(target.getGraphNodeId()) && noConstParams()) { - // do nothing; we've previously discovered and handled this - // receiver for this call site. - } else { - // process the newly discovered target for this call - sideEffect.b = true; - processResolvedCall(node, call, target, constParams, uniqueCatch); - if (!haveAlreadyVisited(target)) { - markDiscovered(target); - } - } - } - } - keys[0] = null; - } - - private boolean noConstParams() { - if (constParams != null) { - for (int i = 0; i < constParams.length; i++) { - if (constParams[i] != null) { - for (int j = 0; j < constParams[i].length; i++) { - if (constParams[i][j] != null) { - return false; - } - } - } - } - } - return true; - } - - - @Override public String toString() { return "Dispatch to " + call + " in node " + node; diff --git a/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/Instantiator.java b/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/Instantiator.java index 802d46ece..49d949a6c 100644 --- a/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/Instantiator.java +++ b/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/Instantiator.java @@ -529,27 +529,7 @@ public class Instantiator implements IInstantiator { return ret; } - /** - * Path back to Object (including T itself). - */ - private List getAllSuper(final TypeReference T) { - if (T.isPrimitiveType()) { - throw new IllegalArgumentException("Not you that call primitive type on :P"); - } - final List ret = new ArrayList<>(); - - IClass cls = this.cha.lookupClass(T); - if (cls == null) { - throw new IllegalArgumentException("The type " + T + " is not in the ClassHierarchy"); - } - - while (cls != null) { - ret.add(cls.getReference()); - cls = cls.getSuperclass(); - } - - return ret; - } + /** * The Constructor starts with 'this()' or 'super()'. diff --git a/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java b/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java index cab2285d0..e4dff3c92 100644 --- a/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java +++ b/com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/util/AndroidManifestXMLReader.java @@ -280,20 +280,6 @@ public class AndroidManifestXMLReader { return Collections.unmodifiableSet(this.relevantAttributes); } - /** - * The given Attr is in {@link #getRelevantAttributes()}. - */ - public boolean isRelevant(Attr attr) { - return relevantAttributes.contains(attr); - } - - /** - * All Tags in this Enum but UNIMPORTANT are relevant. - */ - public boolean isRelevant() { - return (this != Tag.UNIMPORTANT); - } - /** * Match the Tag-Name in the XML-File against the one associated to the Enums Tag. * @@ -310,13 +296,6 @@ public class AndroidManifestXMLReader { } return Tag.UNIMPORTANT; } - - /** - * The Tag appears in the XML File using this name. - */ - public String getName() { - return this.tagName; - } } /** @@ -344,10 +323,6 @@ public class AndroidManifestXMLReader { this.attrName = attrName; } - public boolean isRelevantIn(Tag tag) { - return tag.isRelevant(this); - } - public String getName() { return this.attrName; }