Fix 9 Eclipse warnings about unused methods
Note: some of these methods are decidedly nontrivial. Perhaps they should not actually be removed? If any should be kept around, please identify them to me. I'll revise this change to retain those methods and simply annotate them as needed to suppress Eclipse's warning.
This commit is contained in:
parent
04dafcf7f7
commit
059810c1ca
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -274,13 +274,6 @@ public abstract class FieldBasedCallGraphBuilder {
|
|||
return flowGraph.getReachingSet(functionParam, monitor);
|
||||
}
|
||||
|
||||
private OrdinalSet<FuncVertex> 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.
|
||||
*/
|
||||
|
|
|
@ -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<PointerKey> discoveredUpwardFunargs = HashSetFactory.make();
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -529,27 +529,7 @@ public class Instantiator implements IInstantiator {
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Path back to Object (including T itself).
|
||||
*/
|
||||
private List<TypeReference> getAllSuper(final TypeReference T) {
|
||||
if (T.isPrimitiveType()) {
|
||||
throw new IllegalArgumentException("Not you that call primitive type on :P");
|
||||
}
|
||||
final List<TypeReference> 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()'.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue