Fix all Eclipse warnings about unused local variables

Also report unused variables as errors in the future, not just
warnings.  We've fixed all of these as of right now, so let's keep it
clean in the future too.
This commit is contained in:
Ben Liblit 2017-08-02 18:39:11 -05:00 committed by Manu Sridharan
parent b1cd868e06
commit 678e3e64a6
8 changed files with 3 additions and 12 deletions

View File

@ -119,7 +119,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=error
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled

View File

@ -35,7 +35,6 @@ public class IntraproceduralNullPointerAnalysis {
this.ir = ir;
final int maxVarNum = ir.getSymbolTable().getMaxValueNumber();
final int[] paramValNum = ir.getParameterValueNumbers();
SSACFG cfg = ir.getControlFlowGraph();
final NullPointerFrameWork<ISSABasicBlock> problem = new NullPointerFrameWork<ISSABasicBlock>(
cfg, ir);

View File

@ -135,7 +135,6 @@ public class IntraprocNullPointerAnalysis<T extends ISSABasicBlock> {
} else {
final List<T> catched = searchNodesWithPathToCatchAll(cfg);
final NullPointerFrameWork<T> problem = new NullPointerFrameWork<T>(cfg, ir);
final int[] paramValNum = ir.getParameterValueNumbers();
solver = new NullPointerSolver<T>(problem, maxVarNum, cfg.entry(), ir, initialState);

View File

@ -56,7 +56,6 @@ import com.ibm.wala.ipa.callgraph.propagation.ReturnValueKey;
import com.ibm.wala.ipa.callgraph.propagation.SSAPropagationCallGraphBuilder;
import com.ibm.wala.ipa.callgraph.propagation.cfa.CallerSiteContext;
import com.ibm.wala.ipa.cha.IClassHierarchy;
import com.ibm.wala.ssa.DefUse;
import com.ibm.wala.ssa.IR;
import com.ibm.wala.ssa.ISSABasicBlock;
import com.ibm.wala.ssa.SSAAbstractInvokeInstruction;
@ -261,7 +260,6 @@ public abstract class AbstractDemandFlowGraph extends AbstractFlowGraph {
return;
}
DefUse du = node.getDU();
addNodeInstructionConstraints(node, ir);
addNodePassthruExceptionConstraints(node, ir);
addNodeConstantConstraints(node, ir);

View File

@ -834,7 +834,6 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
if (rhs.size() == 0) {
return NOT_CHANGED;
}
final PointerKey object = rhs.getPointerKey();
PointsToSetVariable def = getFixedSet();
final PointerKey dVal = def.getPointerKey();
@ -922,7 +921,6 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
if (rhs.size() == 0) {
return NOT_CHANGED;
}
PointerKey object = rhs.getPointerKey();
PointsToSetVariable val = getFixedSet();
PointerKey pVal = val.getPointerKey();
@ -1013,7 +1011,6 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
if (ref.size() == 0) {
return NOT_CHANGED;
}
final PointerKey object = ref.getPointerKey();
PointsToSetVariable def = getFixedSet();
final PointerKey dVal = def.getPointerKey();
@ -1130,7 +1127,6 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
if (rhs.size() == 0) {
return NOT_CHANGED;
}
final PointerKey object = rhs.getPointerKey();
PointsToSetVariable val = getFixedSet();
final PointerKey pVal = val.getPointerKey();

View File

@ -2021,7 +2021,6 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
// to take the invoke instruction as a parameter instead, since invs is
// associated with the instruction
final CallSiteReference site = instruction.getCallSite();
IntSet params = getRelevantParameters(caller, site);
final Set<CGNode> targets = HashSetFactory.make();
VoidFunction<InstanceKey[]> f = new VoidFunction<InstanceKey[]>() {
@Override

View File

@ -110,7 +110,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
org.eclipse.jdt.core.compiler.problem.unusedParameter=error
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled

View File

@ -119,7 +119,7 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=error
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=error
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=error
org.eclipse.jdt.core.compiler.problem.unusedParameter=error
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled