diff options
author | 2018-03-28 11:42:55 -0700 | |
---|---|---|
committer | 2018-04-04 14:13:01 +0200 | |
commit | 88a007244f51ed66a62d442e28de483e13a68576 (patch) | |
tree | 7d1f05429efd1553bc18fb54648c7b51922c38a3 /third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/NarrowingConversionNode.java | |
parent | 83d8ef1c4a67c23c103741cca23bafafdc811c79 (diff) |
Update to version 2.4.0 of Checker Framework dataflow and javacutil
Change-Id: I29e007625d0a25279d8b2967f89b1014b4825bd6
Diffstat (limited to 'third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/NarrowingConversionNode.java')
-rw-r--r-- | third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/NarrowingConversionNode.java | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/NarrowingConversionNode.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/NarrowingConversionNode.java deleted file mode 100644 index 79a47283eb..0000000000 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/NarrowingConversionNode.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.checkerframework.dataflow.cfg.node; - -import com.sun.source.tree.Tree; -import java.util.Collection; -import java.util.Collections; -import javax.lang.model.type.TypeMirror; -import org.checkerframework.dataflow.util.HashCodeUtils; -import org.checkerframework.javacutil.TypesUtils; - -/** - * A node for the narrowing primitive conversion operation. See JLS 5.1.3 for the definition of - * narrowing primitive conversion. - * - * <p>A {@link NarrowingConversionNode} does not correspond to any tree node in the parsed AST. It - * is introduced when a value of some primitive type appears in a context that requires a different - * primitive with more bits of precision. - * - * @author Stefan Heule - * @author Charlie Garrett - */ -public class NarrowingConversionNode extends Node { - - protected Tree tree; - protected Node operand; - - public NarrowingConversionNode(Tree tree, Node operand, TypeMirror type) { - super(type); - assert TypesUtils.isPrimitive(type) : "non-primitive type in narrowing conversion"; - this.tree = tree; - this.operand = operand; - } - - public Node getOperand() { - return operand; - } - - @Override - public TypeMirror getType() { - return type; - } - - @Override - public Tree getTree() { - return tree; - } - - @Override - public <R, P> R accept(NodeVisitor<R, P> visitor, P p) { - return visitor.visitNarrowingConversion(this, p); - } - - @Override - public String toString() { - return "NarrowingConversion(" + getOperand() + ", " + type + ")"; - } - - @Override - public boolean equals(Object obj) { - if (obj == null || !(obj instanceof NarrowingConversionNode)) { - return false; - } - NarrowingConversionNode other = (NarrowingConversionNode) obj; - return getOperand().equals(other.getOperand()) - && TypesUtils.areSamePrimitiveTypes(getType(), other.getType()); - } - - @Override - public int hashCode() { - return HashCodeUtils.hash(getOperand()); - } - - @Override - public Collection<Node> getOperands() { - return Collections.singletonList(getOperand()); - } -} |