Fix additional uses of raw types related to IVariable

These were not producing warnings in the Eclipse Oxygen GUI, and also
produced no warnings from Tycho when running Maven tests on my local
machine.  However, they did result in errors under Travis-CI.  I'm not
sure why this inconsistency exists, but hopefully we have now fixed
these raw-type uses in a way that makes everything happy.
This commit is contained in:
Ben Liblit 2017-07-11 14:00:57 -07:00 committed by Manu Sridharan
parent 1d27ca974b
commit 9d6e362eaa
25 changed files with 31 additions and 44 deletions

View File

@ -19,7 +19,7 @@ public class OperatorUtil {
*
* @author Martin Hecker, martin.hecker@kit.edu
*/
public static class UnaryOperatorSequence<T extends IVariable> extends UnaryOperator<T> {
public static class UnaryOperatorSequence<T extends IVariable<T>> extends UnaryOperator<T> {
final UnaryOperator<T>[] operators;

View File

@ -31,7 +31,7 @@ import com.ibm.wala.ssa.SymbolTable;
*
* @see TypeInference for the canonical client of this machinery.
*/
public abstract class SSAInference<T extends IVariable<?>> extends DefaultFixedPointSolver<T> {
public abstract class SSAInference<T extends IVariable<T>> extends DefaultFixedPointSolver<T> {
static final boolean DEBUG = false;
/**
@ -49,7 +49,7 @@ public abstract class SSAInference<T extends IVariable<?>> extends DefaultFixedP
*/
private IVariable[] vars;
public interface OperatorFactory<T extends IVariable> {
public interface OperatorFactory<T extends IVariable<T>> {
/**
* Get the dataflow operator induced by an instruction in SSA form.
*

View File

@ -16,8 +16,7 @@ import com.ibm.wala.fixpoint.IVariable;
/**
* Abstract superclass for meet operators
*/
@SuppressWarnings("rawtypes")
public abstract class AbstractMeetOperator<T extends IVariable> extends AbstractOperator<T> {
public abstract class AbstractMeetOperator<T extends IVariable<T>> extends AbstractOperator<T> {
/**
* subclasses can override if needed

View File

@ -16,8 +16,7 @@ import com.ibm.wala.util.graph.Graph;
/**
* a basic implementation of the dataflow framework
*/
@SuppressWarnings("rawtypes")
public class BasicFramework<T, V extends IVariable> implements IKilldallFramework<T, V> {
public class BasicFramework<T, V extends IVariable<V>> implements IKilldallFramework<T, V> {
private final Graph<T> flowGraph;
private final ITransferFunctionProvider<T, V> transferFunctionProvider;

View File

@ -25,7 +25,7 @@ import com.ibm.wala.util.intset.IntegerUnionFind;
/**
* Iterative solver for a Killdall dataflow framework
*/
public abstract class DataflowSolver<T, V extends IVariable<?>> extends DefaultFixedPointSolver<V> {
public abstract class DataflowSolver<T, V extends IVariable<V>> extends DefaultFixedPointSolver<V> {
/**
* the dataflow problem to solve

View File

@ -19,8 +19,7 @@ import com.ibm.wala.util.graph.Graph;
*
* @param <T> type of nodes in the graph
*/
@SuppressWarnings("rawtypes")
public interface IKilldallFramework<T,V extends IVariable> {
public interface IKilldallFramework<T,V extends IVariable<V>> {
/**
* @return the flow graph which induces this dataflow problem

View File

@ -21,8 +21,7 @@ import com.ibm.wala.fixpoint.UnaryOperator;
* @param <T> type of node in the graph
* @param <V> type of abstract states computed
*/
@SuppressWarnings("rawtypes")
public interface ITransferFunctionProvider<T, V extends IVariable> {
public interface ITransferFunctionProvider<T, V extends IVariable<V>> {
/**
* @return the transfer function from IN_node -&gt; OUT_node

View File

@ -37,7 +37,7 @@ import com.ibm.wala.util.debug.VerboseAction;
* Fixed-point iteration proceeds in a topological order according to these edges.
*/
@SuppressWarnings("rawtypes")
public abstract class AbstractFixedPointSolver<T extends IVariable<?>> implements IFixedPointSolver<T>, FixedPointConstants,
public abstract class AbstractFixedPointSolver<T extends IVariable<T>> implements IFixedPointSolver<T>, FixedPointConstants,
VerboseAction {
static final boolean DEBUG = false;

View File

@ -15,8 +15,7 @@ import com.ibm.wala.fixpoint.IVariable;
/**
* An implementation of NullaryStep that carries its operator explicitly
*/
@SuppressWarnings("rawtypes")
public class BasicNullaryStatement<T extends IVariable> extends NullaryStatement<T> {
public class BasicNullaryStatement<T extends IVariable<T>> extends NullaryStatement<T> {
/**
* The operator in the equation

View File

@ -17,7 +17,7 @@ import com.ibm.wala.fixpoint.IVariable;
/**
* Default implementation of a fixed point solver.
*/
public abstract class DefaultFixedPointSolver<T extends IVariable<?>> extends AbstractFixedPointSolver<T> {
public abstract class DefaultFixedPointSolver<T extends IVariable<T>> extends AbstractFixedPointSolver<T> {
private final DefaultFixedPointSystem<T> graph;

View File

@ -33,7 +33,7 @@ import com.ibm.wala.util.graph.traverse.Topological;
/**
* Default implementation of a dataflow graph
*/
public class DefaultFixedPointSystem<T extends IVariable<?>> implements IFixedPointSystem<T> {
public class DefaultFixedPointSystem<T extends IVariable<T>> implements IFixedPointSystem<T> {
static final boolean DEBUG = false;
/**

View File

@ -17,7 +17,7 @@ import com.ibm.wala.fixpoint.IVariable;
/**
* Represents a single step in an iterative solver
*/
public abstract class GeneralStatement<T extends IVariable<?>> extends AbstractStatement<T, AbstractOperator<T>> {
public abstract class GeneralStatement<T extends IVariable<T>> extends AbstractStatement<T, AbstractOperator<T>> {
protected final T lhs;

View File

@ -17,8 +17,7 @@ import com.ibm.wala.fixpoint.IVariable;
/**
* An operator of the form lhs = op
*/
@SuppressWarnings("rawtypes")
public abstract class NullaryOperator<T extends IVariable> extends AbstractOperator<T> {
public abstract class NullaryOperator<T extends IVariable<T>> extends AbstractOperator<T> {
@Override
public byte evaluate(T lhs, T[] rhs) throws UnsupportedOperationException {

View File

@ -17,8 +17,7 @@ import com.ibm.wala.fixpoint.IVariable;
* Represents a single step, restricted to a nullary
* operator.
*/
@SuppressWarnings("rawtypes")
public abstract class NullaryStatement<T extends IVariable> extends AbstractStatement<T, NullaryOperator<T>> {
public abstract class NullaryStatement<T extends IVariable<T>> extends AbstractStatement<T, NullaryOperator<T>> {
/**
* The operands
@ -70,7 +69,7 @@ public abstract class NullaryStatement<T extends IVariable> extends AbstractStat
@Override
public boolean equals(Object o) {
if (o instanceof NullaryStatement) {
NullaryStatement other = (NullaryStatement) o;
NullaryStatement<?> other = (NullaryStatement<?>) o;
if (!getOperator().equals(other.getOperator())) {
return false;

View File

@ -16,8 +16,7 @@ package com.ibm.wala.fixpoint;
*
* This is an abstract class and not an interface in order to force subclasses to re-implement equals(), hashCode(), and toString()
*/
@SuppressWarnings("rawtypes")
public abstract class AbstractOperator<T extends IVariable> implements FixedPointConstants {
public abstract class AbstractOperator<T extends IVariable<T>> implements FixedPointConstants {
/**
* Evaluate this equation, setting a new value for the left-hand side.

View File

@ -15,7 +15,7 @@ import com.ibm.wala.util.graph.impl.NodeWithNumber;
/**
* Represents a single step in an iterative solver
*/
public abstract class AbstractStatement<T extends IVariable<?>, O extends AbstractOperator<T>> extends NodeWithNumber implements IFixedPointStatement<T>{
public abstract class AbstractStatement<T extends IVariable<T>, O extends AbstractOperator<T>> extends NodeWithNumber implements IFixedPointStatement<T>{
public abstract O getOperator();

View File

@ -15,8 +15,7 @@ import com.ibm.wala.util.graph.impl.NodeWithNumber;
/**
* Represents a single variable in a fixed-point system.
*/
@SuppressWarnings("rawtypes")
public abstract class AbstractVariable<T extends AbstractVariable> extends NodeWithNumber implements IVariable<T> {
public abstract class AbstractVariable<T extends AbstractVariable<T>> extends NodeWithNumber implements IVariable<T> {
private static int nextHashCode = 0;

View File

@ -14,8 +14,7 @@ package com.ibm.wala.fixpoint;
/**
* An implementation of UnaryStatement that carries its operator explicitly
*/
@SuppressWarnings("rawtypes")
public class BasicUnaryStatement<T extends IVariable> extends UnaryStatement<T> {
public class BasicUnaryStatement<T extends IVariable<T>> extends UnaryStatement<T> {
private final UnaryOperator<T> operator;

View File

@ -18,7 +18,7 @@ import com.ibm.wala.util.MonitorUtil.IProgressMonitor;
/**
* Solves a set of constraints
*/
public interface IFixedPointSolver<T extends IVariable<?>> {
public interface IFixedPointSolver<T extends IVariable<T>> {
/**
* @return the set of statements solved by this {@link IFixedPointSolver}

View File

@ -27,8 +27,7 @@ import com.ibm.wala.util.graph.INodeWithNumber;
* Intuitively, a statement definition corresponds to an "equation" in dataflow parlance, or
* a "constraint" in constraint solvers.
*/
@SuppressWarnings("rawtypes")
public interface IFixedPointStatement<T extends IVariable> extends INodeWithNumber {
public interface IFixedPointStatement<T extends IVariable<T>> extends INodeWithNumber {
/**
* @return the left-hand side of this statement.
*/

View File

@ -16,7 +16,7 @@ import java.util.Iterator;
* Represents a set of {@link IFixedPointStatement}s to be solved by a {@link IFixedPointSolver}
*/
@SuppressWarnings("rawtypes")
public interface IFixedPointSystem<T extends IVariable> {
public interface IFixedPointSystem<T extends IVariable<T>> {
/**
* removes a given statement

View File

@ -16,8 +16,7 @@ import com.ibm.wala.util.graph.INodeWithNumber;
/**
* Represents a single variable in a fixed-point iterative system.
*/
@SuppressWarnings("rawtypes")
public interface IVariable<T extends IVariable> extends INodeWithNumber {
public interface IVariable<T extends IVariable<T>> extends INodeWithNumber {
/**
* Variables must allow the solver implementation to get/set an order number,

View File

@ -20,7 +20,7 @@ import com.ibm.wala.util.intset.MutableIntSet;
* TODO: optimize the representation more; e.g. BitVectors with non-zero lower bound.
*/
@SuppressWarnings("rawtypes")
public abstract class IntSetVariable<T extends IntSetVariable> extends AbstractVariable<T> {
public abstract class IntSetVariable<T extends IntSetVariable<T>> extends AbstractVariable<T> {
MutableIntSet V;

View File

@ -16,8 +16,7 @@ import com.ibm.wala.util.debug.UnimplementedError;
/**
* An operator of the form lhs = op (rhs)
*/
@SuppressWarnings("rawtypes")
public abstract class UnaryOperator<T extends IVariable> extends AbstractOperator<T> {
public abstract class UnaryOperator<T extends IVariable<T>> extends AbstractOperator<T> {
/**
* Evaluate this equation, setting a new value for the left-hand side.

View File

@ -15,8 +15,7 @@ package com.ibm.wala.fixpoint;
/**
* Represents a single step, restricted to a unary operator.
*/
@SuppressWarnings("rawtypes")
public abstract class UnaryStatement<T extends IVariable> extends AbstractStatement<T, UnaryOperator<T>> {
public abstract class UnaryStatement<T extends IVariable<T>> extends AbstractStatement<T, UnaryOperator<T>> {
/**
* The operands
@ -56,8 +55,9 @@ public abstract class UnaryStatement<T extends IVariable> extends AbstractStatem
/**
* Return the operands in this equation.
*/
public IVariable[] getOperands() {
IVariable[] result = new IVariable[2];
public IVariable<T>[] getOperands() {
@SuppressWarnings("unchecked")
IVariable<T>[] result = new IVariable[2];
result[0] = lhs;
result[1] = rhs;
return result;
@ -108,7 +108,7 @@ public abstract class UnaryStatement<T extends IVariable> extends AbstractStatem
@Override
public boolean equals(Object o) {
if (o instanceof UnaryStatement) {
UnaryStatement other = (UnaryStatement) o;
UnaryStatement<?> other = (UnaryStatement<?>) o;
if (!getOperator().equals(other.getOperator())) {
return false;