Fix all Eclipse warnings about unnecessary semicolons

I have *not* upgraded this problem to be treated as an error in the
future.  Unfortunately Eclipse uses a single configuration setting for
both unnecessary semicolons and also for empty control-flow statements
like `while (p) ;`.  I'm not convinced that it's worth rewriting all
instances of the latter into `while (p) { }`.  So this is just going
to stay as a warning for now.
This commit is contained in:
Ben Liblit 2017-07-12 16:54:57 -07:00 committed by Manu Sridharan
parent 594525a83f
commit a888a49fdd
38 changed files with 46 additions and 50 deletions

View File

@ -55,7 +55,7 @@ public class NuValidatorHtmlParser implements IHtmlParser {
parser.setXmlPolicy(XmlViolationPolicy.ALLOW); parser.setXmlPolicy(XmlViolationPolicy.ALLOW);
parser.setContentHandler(new ContentHandler() { parser.setContentHandler(new ContentHandler() {
private Locator locator; private Locator locator;
private Stack<ITag> tags = new Stack<>();; private Stack<ITag> tags = new Stack<>();
private int countLines(char[] ch, int start, int length) { private int countLines(char[] ch, int start, int length) {
LineNumberReader r = new LineNumberReader(new StringReader (new String(ch, start, length))); LineNumberReader r = new LineNumberReader(new StringReader (new String(ch, start, length)));

View File

@ -2394,7 +2394,7 @@ private CAstNode[] walkChildren(final Node n, WalkContext context) {
public void warning(String arg0, String arg1, int arg2, String arg3, int arg4) { public void warning(String arg0, String arg1, int arg2, String arg3, int arg4) {
// ignore warnings // ignore warnings
} }
}; }
CAstErrorReporter reporter = new CAstErrorReporter(); CAstErrorReporter reporter = new CAstErrorReporter();
CompilerEnvirons compilerEnv = new CompilerEnvirons(); CompilerEnvirons compilerEnv = new CompilerEnvirons();

View File

@ -54,7 +54,7 @@ import com.ibm.wala.util.functions.Function;
* *
*/ */
public class FieldBasedCGUtil { public class FieldBasedCGUtil {
public static enum BuilderType { PESSIMISTIC, OPTIMISTIC, OPTIMISTIC_WORKLIST }; public static enum BuilderType { PESSIMISTIC, OPTIMISTIC, OPTIMISTIC_WORKLIST }
private final JavaScriptTranslatorFactory translatorFactory; private final JavaScriptTranslatorFactory translatorFactory;

View File

@ -81,7 +81,6 @@ public class JSTypeInference extends AstTypeInference {
result = new DeclaredTypeOperator(new ConeType(cha.getRootClass())); result = new DeclaredTypeOperator(new ConeType(cha.getRootClass()));
} }
} }
;
class JSTypeVarFactory extends TypeVarFactory { class JSTypeVarFactory extends TypeVarFactory {
@ -104,7 +103,6 @@ public class JSTypeInference extends AstTypeInference {
} }
} }
} }
;
init(ir, new JSTypeVarFactory(), new JSTypeOperatorFactory()); init(ir, new JSTypeVarFactory(), new JSTypeOperatorFactory());
} }

View File

@ -4,7 +4,7 @@ import com.ibm.wala.ipa.callgraph.propagation.PointerKey;
public class PrototypeFieldVertex extends Vertex implements PointerKey { public class PrototypeFieldVertex extends Vertex implements PointerKey {
public enum PrototypeField { __proto__, prototype }; public enum PrototypeField { __proto__, prototype }
private final PrototypeField field; private final PrototypeField field;
private final ObjectVertex type; private final ObjectVertex type;

View File

@ -116,7 +116,7 @@ public abstract class JavaScriptAnalysisEngine<I extends InstanceKey> extends Ab
} }
public static class FieldBasedJavaScriptAnalysisEngine extends JavaScriptAnalysisEngine<ObjectVertex> { public static class FieldBasedJavaScriptAnalysisEngine extends JavaScriptAnalysisEngine<ObjectVertex> {
public enum BuilderType { PESSIMISTIC, OPTIMISTIC, REFLECTIVE }; public enum BuilderType { PESSIMISTIC, OPTIMISTIC, REFLECTIVE }
private BuilderType builderType = BuilderType.OPTIMISTIC; private BuilderType builderType = BuilderType.OPTIMISTIC;

View File

@ -125,7 +125,7 @@ public class RangeFileMapping implements FileMapping {
public String toString() { public String toString() {
return "[include:"+includePosition+"]"+super.toString(); return "[include:"+includePosition+"]"+super.toString();
} }
}; }
return new Pos(); return new Pos();
} else { } else {

View File

@ -321,7 +321,7 @@ public class JSCallGraphUtil extends com.ibm.wala.cast.ipa.callgraph.CAstCallGra
public URL getURL() { public URL getURL() {
return url; return url;
} }
}; }
public static Module getPrologueFile(final String name) { public static Module getPrologueFile(final String name) {
return new Bootstrap(name, JSCallGraphUtil.class.getClassLoader().getResourceAsStream(name), JSCallGraphUtil.class.getClassLoader().getResource(name)); return new Bootstrap(name, JSCallGraphUtil.class.getClassLoader().getResourceAsStream(name), JSCallGraphUtil.class.getClassLoader().getResource(name));

View File

@ -390,13 +390,13 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
public void visitPrototypeLookup(PrototypeLookup instruction) { public void visitPrototypeLookup(PrototypeLookup instruction) {
} }
}; }
@Override @Override
protected ImplicitPointsToSetVisitor makeImplicitPointsToVisitor(LocalPointerKey lpk) { protected ImplicitPointsToSetVisitor makeImplicitPointsToVisitor(LocalPointerKey lpk) {
return new JSImplicitPointsToSetVisitor(this, lpk); return new JSImplicitPointsToSetVisitor(this, lpk);
} }
}; }
@Override @Override
protected PropagationSystem makeSystem(AnalysisOptions options) { protected PropagationSystem makeSystem(AnalysisOptions options) {
@ -639,7 +639,7 @@ public class JSSSAPropagationCallGraphBuilder extends AstSSAPropagationCallGraph
public String toString() { public String toString() {
return "sub-dispatch for " + instruction + ": " + receiverType + ", " + fieldKey; return "sub-dispatch for " + instruction + ": " + receiverType + ", " + fieldKey;
} }
}; }
system.newSideEffect(new FieldValueDispatch(), fieldKey); system.newSideEffect(new FieldValueDispatch(), fieldKey);
} }

View File

@ -153,7 +153,7 @@ public class PropertyNameContextSelector implements ContextSelector {
this.base = base; this.base = base;
} }
private enum Frequency { NEVER, SOMETIMES, ALWAYS }; private enum Frequency { NEVER, SOMETIMES, ALWAYS }
private final HashMap<MethodReference, Frequency> usesFirstArgAsPropertyName_cache = HashMapFactory.make(); private final HashMap<MethodReference, Frequency> usesFirstArgAsPropertyName_cache = HashMapFactory.make();
/** Determine whether the method never/sometimes/always uses its first argument as a property name. */ /** Determine whether the method never/sometimes/always uses its first argument as a property name. */

View File

@ -95,7 +95,7 @@ public class PropertyReadExpander extends CAstRewriter<PropertyReadExpander.Rewr
this.elementTemp = elementTemp; this.elementTemp = elementTemp;
} }
}; }
private final static RewriteContext READ = new RewriteContext() { private final static RewriteContext READ = new RewriteContext() {
@Override @Override

View File

@ -73,7 +73,7 @@ public abstract class AstTypeInference extends TypeInference {
public void visitEcho(AstEchoInstruction inst) { public void visitEcho(AstEchoInstruction inst) {
} }
}; }
public AstTypeInference(IR ir, IClassHierarchy cha, TypeAbstraction booleanType, boolean doPrimitives) { public AstTypeInference(IR ir, IClassHierarchy cha, TypeAbstraction booleanType, boolean doPrimitives) {
super(ir, doPrimitives); super(ir, doPrimitives);

View File

@ -240,7 +240,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
} }
} }
}; }
// ///////////////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////////////
// //
@ -1209,7 +1209,7 @@ public abstract class AstSSAPropagationCallGraphBuilder extends SSAPropagationCa
system.newConstraint(fieldKey, assignOperator, rhs); system.newConstraint(fieldKey, assignOperator, rhs);
} }
} }
}; }
public void newFieldWrite(CGNode opNode, int objVn, int fieldsVn, final PointerKey rhs) { public void newFieldWrite(CGNode opNode, int objVn, int fieldsVn, final PointerKey rhs) {
newFieldOperation(opNode, objVn, fieldsVn, false, new NormalWriter(rhs)); newFieldOperation(opNode, objVn, fieldsVn, false, new NormalWriter(rhs));

View File

@ -1385,7 +1385,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
public static enum ScopeType { public static enum ScopeType {
LOCAL, GLOBAL, SCRIPT, FUNCTION, TYPE LOCAL, GLOBAL, SCRIPT, FUNCTION, TYPE
}; }
private static final boolean DEBUG = false; private static final boolean DEBUG = false;
@ -1556,7 +1556,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
public Scope getDefiningScope() { public Scope getDefiningScope() {
return definingScope; return definingScope;
} }
}; }
public abstract class AbstractScope implements Scope { public abstract class AbstractScope implements Scope {
private final Scope parent; private final Scope parent;
@ -1711,7 +1711,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
@Override @Override
public abstract CAstEntity getEntity(); public abstract CAstEntity getEntity();
}; }
protected AbstractScope makeScriptScope(final CAstEntity s, Scope parent) { protected AbstractScope makeScriptScope(final CAstEntity s, Scope parent) {
return new AbstractScope(parent) { return new AbstractScope(parent) {
@ -2982,7 +2982,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
return false; return false;
} }
}; }
/** /**
* record that in entity e, the access is performed. * record that in entity e, the access is performed.
@ -4784,7 +4784,7 @@ public abstract class AstTranslator extends CAstVisitor<AstTranslator.WalkContex
return globalScope; return globalScope;
} }
}; }
/** /**
* translate module, represented by {@link CAstEntity} N * translate module, represented by {@link CAstEntity} N

View File

@ -215,6 +215,6 @@ public interface TranslatorToCAst {
breakNode); breakNode);
} }
} }
}; }
} }

View File

@ -199,7 +199,7 @@ public abstract class AstMethod implements IMethod {
return (o instanceof LexicalParent) && getName().equals(((LexicalParent) o).getName()) return (o instanceof LexicalParent) && getName().equals(((LexicalParent) o).getName())
&& getMethod().equals(((LexicalParent) o).getMethod()); && getMethod().equals(((LexicalParent) o).getMethod());
} }
}; }
public abstract LexicalParent[] getParents(); public abstract LexicalParent[] getParents();

View File

@ -22,4 +22,4 @@ public interface CAstReference {
CAstType type(); CAstType type();
}; }

View File

@ -67,7 +67,7 @@ public abstract class CAstBasicRewriter
public NoKey parent() { public NoKey parent() {
return null; return null;
} }
}; }
protected CAstBasicRewriter(CAst Ast, boolean recursive) { protected CAstBasicRewriter(CAst Ast, boolean recursive) {
super(Ast, recursive, new NonCopyingContext()); super(Ast, recursive, new NonCopyingContext());

View File

@ -71,7 +71,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
*/ */
Self parent(); Self parent();
}; }
/** /**
* interface to be implemented by contexts used while traversing the AST * interface to be implemented by contexts used while traversing the AST
@ -83,7 +83,7 @@ public abstract class CAstRewriter<C extends CAstRewriter.RewriteContext<K>, K e
*/ */
K key(); K key();
}; }
/** /**
* represents a rewritten CAst * represents a rewritten CAst

View File

@ -28,7 +28,7 @@ public class GetMethodContext {
} }
public void baz() { public void baz() {
} }
}; }
public static class B extends A { public static class B extends A {
@Override @Override
@ -40,7 +40,7 @@ public class GetMethodContext {
@Override @Override
public void baz() { public void baz() {
} }
}; }
public static class C extends B { public static class C extends B {
@Override @Override
@ -49,7 +49,7 @@ public class GetMethodContext {
@Override @Override
public void bar() { public void bar() {
} }
}; }
public static void main(String[] args) throws IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException { public static void main(String[] args) throws IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException {
Method m; Method m;

View File

@ -23,5 +23,5 @@ public class SoftFinalHyperNode<T> extends HyperNode<T> {
if (weight.equals(Weight.NOT_SET) || this.getWeight().equals(Weight.NOT_SET)) { if (weight.equals(Weight.NOT_SET) || this.getWeight().equals(Weight.NOT_SET)) {
super.setWeight(weight); super.setWeight(weight);
} }
}; }
} }

View File

@ -31,7 +31,7 @@ public class NullPointerState extends AbstractVariable<NullPointerState> {
* Inital state is UNKNOWN. * Inital state is UNKNOWN.
* Lattice: BOTH < { NULL, NOT_NULL } < UNKNOWN * Lattice: BOTH < { NULL, NOT_NULL } < UNKNOWN
*/ */
public enum State { UNKNOWN, BOTH, NULL, NOT_NULL }; public enum State { UNKNOWN, BOTH, NULL, NOT_NULL }
// maps ssa variable number -> State // maps ssa variable number -> State
private final State[] vars; private final State[] vars;

View File

@ -229,7 +229,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
* The budget specified in the {@link RefinementPolicy} was exceeded on all refinement passes * The budget specified in the {@link RefinementPolicy} was exceeded on all refinement passes
*/ */
BUDGETEXCEEDED BUDGETEXCEEDED
}; }
/** /**
* re-initialize state for a new query * re-initialize state for a new query

View File

@ -209,7 +209,7 @@ public class PointerAnalysisImpl extends AbstractPointerAnalysis {
public void visitArrayLoad(SSAArrayLoadInstruction instruction) { public void visitArrayLoad(SSAArrayLoadInstruction instruction) {
pointsToSet = analysis.computeImplicitPointsToSetAtALoad(node, instruction); pointsToSet = analysis.computeImplicitPointsToSetAtALoad(node, instruction);
} }
}; }
protected ImplicitPointsToSetVisitor makeImplicitPointsToVisitor(LocalPointerKey lpk) { protected ImplicitPointsToSetVisitor makeImplicitPointsToVisitor(LocalPointerKey lpk) {
return new ImplicitPointsToSetVisitor(this, lpk); return new ImplicitPointsToSetVisitor(this, lpk);

View File

@ -1490,6 +1490,6 @@ public abstract class PropagationCallGraphBuilder implements CallGraphBuilder<In
@Override @Override
public IAnalysisCacheView getAnalysisCache() { public IAnalysisCacheView getAnalysisCache() {
return analysisCache; return analysisCache;
}; }
} }

View File

@ -72,7 +72,6 @@ public class TargetMethodContextSelector implements ContextSelector {
return (o instanceof MethodDispatchContext) && ((MethodDispatchContext) o).getTargetMethod().equals(M); return (o instanceof MethodDispatchContext) && ((MethodDispatchContext) o).getTargetMethod().equals(M);
} }
} }
;
return new MethodDispatchContext(); return new MethodDispatchContext();
} }

View File

@ -72,7 +72,7 @@ public abstract class CallStringContextSelector implements ContextSelector {
public CallString getCallString() { public CallString getCallString() {
return cs; return cs;
} }
}; }
protected final ContextSelector base; protected final ContextSelector base;

View File

@ -264,6 +264,6 @@ public class DelegatingExplicitCallGraph extends ExplicitCallGraph {
@Override @Override
protected ExplicitEdgeManager makeEdgeManger() { protected ExplicitEdgeManager makeEdgeManger() {
return new DelegatingEdgeManager(); return new DelegatingEdgeManager();
}; }
} }

View File

@ -34,7 +34,7 @@ public class ExceptionPrunedCFG {
public boolean hasExceptionalEdge(T src, T dst) { public boolean hasExceptionalEdge(T src, T dst) {
return false; return false;
} }
}; }
public static <I, T extends IBasicBlock<I>> PrunedCFG<I, T> make(ControlFlowGraph<I, T> cfg) { public static <I, T extends IBasicBlock<I>> PrunedCFG<I, T> make(ControlFlowGraph<I, T> cfg) {
return PrunedCFG.make(cfg, new ExceptionEdgePruner<I, T>(cfg)); return PrunedCFG.make(cfg, new ExceptionEdgePruner<I, T>(cfg));

View File

@ -77,7 +77,7 @@ import com.ibm.wala.util.intset.OrdinalSet;
public class PDG<T extends InstanceKey> implements NumberedGraph<Statement> { public class PDG<T extends InstanceKey> implements NumberedGraph<Statement> {
/** BEGIN Custom change: control deps */ /** BEGIN Custom change: control deps */
public enum Dependency {CONTROL_DEP, DATA_AND_CONTROL_DEP}; public enum Dependency {CONTROL_DEP, DATA_AND_CONTROL_DEP}
private final SlowSparseNumberedLabeledGraph<Statement, Dependency> delegate = private final SlowSparseNumberedLabeledGraph<Statement, Dependency> delegate =
new SlowSparseNumberedLabeledGraph<Statement, Dependency>(Dependency.DATA_AND_CONTROL_DEP); new SlowSparseNumberedLabeledGraph<Statement, Dependency>(Dependency.DATA_AND_CONTROL_DEP);

View File

@ -747,5 +747,5 @@ public abstract class IR implements IRView {
*/ */
public SSAOptions getOptions() { public SSAOptions getOptions() {
return options; return options;
}; }
} }

View File

@ -416,7 +416,7 @@ public class SSAValueManager {
throw new IllegalArgumentException("The argument key may not be null"); throw new IllegalArgumentException("The argument key may not be null");
} }
final SSAValue cand;; final SSAValue cand;
currentScope--; currentScope--;
assert(currentScope >= 0 ); assert(currentScope >= 0 );
cand = getCurrent(key); cand = getCurrent(key);

View File

@ -61,7 +61,7 @@ import com.ibm.wala.util.functions.Function;
public class EclipseJavaScriptAnalysisEngine<I extends InstanceKey> extends EclipseProjectSourceAnalysisEngine<IJavaScriptProject, I> { public class EclipseJavaScriptAnalysisEngine<I extends InstanceKey> extends EclipseProjectSourceAnalysisEngine<IJavaScriptProject, I> {
public enum BuilderType { PESSIMISTIC, OPTIMISTIC, REFLECTIVE }; public enum BuilderType { PESSIMISTIC, OPTIMISTIC, REFLECTIVE }
private final BuilderType builderType; private final BuilderType builderType;

View File

@ -73,7 +73,7 @@ public class JsdtUtil {
public static class CGInfo { public static class CGInfo {
public final Graph<IMember> cg = SlowSparseNumberedGraph.make(); public final Graph<IMember> cg = SlowSparseNumberedGraph.make();
public final Set<FunctionInvocation> calls = HashSetFactory.make(); public final Set<FunctionInvocation> calls = HashSetFactory.make();
}; }
public static Set<ModuleEntry> getJavaScriptCodeFromProject(String project) throws IOException, CoreException { public static Set<ModuleEntry> getJavaScriptCodeFromProject(String project) throws IOException, CoreException {
IJavaScriptProject p = JavaScriptHeadlessUtil.getJavaScriptProjectFromWorkspace(project); IJavaScriptProject p = JavaScriptHeadlessUtil.getJavaScriptProjectFromWorkspace(project);

View File

@ -74,7 +74,7 @@ public abstract class EclipseProjectPath<E, P> {
public interface ILoader { public interface ILoader {
ClassLoaderReference ref(); ClassLoaderReference ref();
}; }
/** /**
* Eclipse projects are modeled with 3 loaders, as described above. * Eclipse projects are modeled with 3 loaders, as described above.
@ -93,7 +93,7 @@ public abstract class EclipseProjectPath<E, P> {
public ClassLoaderReference ref() { public ClassLoaderReference ref() {
return ref; return ref;
} }
}; }
public enum AnalysisScopeType { public enum AnalysisScopeType {
NO_SOURCE, SOURCE_FOR_PROJ, SOURCE_FOR_PROJ_AND_LINKED_PROJS NO_SOURCE, SOURCE_FOR_PROJ, SOURCE_FOR_PROJ_AND_LINKED_PROJS

View File

@ -45,7 +45,7 @@ public final class Debug {
public boolean isHigherPriority(LogLevel l) { public boolean isHigherPriority(LogLevel l) {
return priority > l.priority; return priority > l.priority;
} }
}; }
private static PrintStream OUT_STREAM = System.out; private static PrintStream OUT_STREAM = System.out;

View File

@ -52,7 +52,7 @@ public class Topological {
finishTime = null; finishTime = null;
Graph<T> G_T = GraphInverter.invert(graph); Graph<T> G_T = GraphInverter.invert(graph);
return DFS.iterateFinishTime(G_T, rev); return DFS.iterateFinishTime(G_T, rev);
}; }
}; };
} }
} }

View File

@ -339,7 +339,6 @@ public class SemiSparseMutableIntSet implements MutableIntSet {
return next; return next;
} }
} }
;
if (sparsePart.isEmpty()) { if (sparsePart.isEmpty()) {
if (densePart == null || densePart.isZero()) { if (densePart == null || densePart.isZero()) {