aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java')
-rw-r--r--third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java93
1 files changed, 33 insertions, 60 deletions
diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java
index f59cc81bb8..fb5bf5335d 100644
--- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java
+++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/node/Node.java
@@ -4,67 +4,52 @@ package org.checkerframework.dataflow.cfg.node;
import org.checkerframework.checker.nullness.qual.Nullable;
*/
-import org.checkerframework.dataflow.cfg.CFGBuilder;
-import org.checkerframework.dataflow.cfg.block.Block;
-
+import com.sun.source.tree.Tree;
import java.util.Collection;
import java.util.LinkedList;
-
import javax.lang.model.type.TypeMirror;
-
-import com.sun.source.tree.Tree;
+import org.checkerframework.dataflow.cfg.CFGBuilder;
+import org.checkerframework.dataflow.cfg.block.Block;
/**
- * A node in the abstract representation used for Java code inside a basic
- * block.
+ * A node in the abstract representation used for Java code inside a basic block.
*
- * <p>
- *
- * The following invariants hold:
+ * <p>The following invariants hold:
*
* <pre>
* block == null || block instanceof RegularBlock || block instanceof ExceptionBlock
- * block instanceof RegularBlock ==&gt; block.getContents().contains(this)
- * block instanceof ExceptionBlock ==&gt; block.getNode() == this
- * block == null &lt;==&gt; "This object represents a parameter of the method."
+ * block instanceof RegularBlock &rArr; block.getContents().contains(this)
+ * block instanceof ExceptionBlock &rArr; block.getNode() == this
+ * block == null &hArr; "This object represents a parameter of the method."
* </pre>
*
* <pre>
* type != null
- * tree != null ==&gt; node.getType() == InternalUtils.typeOf(node.getTree())
+ * tree != null &rArr; node.getType() == InternalUtils.typeOf(node.getTree())
* </pre>
*
* @author Stefan Heule
- *
*/
public abstract class Node {
- /**
- * The basic block this node belongs to (see invariant about this field
- * above).
- */
+ /** The basic block this node belongs to (see invariant about this field above). */
protected /*@Nullable*/ Block block;
- /**
- * Is this node an l-value?
- */
+ /** Is this node an l-value? */
protected boolean lvalue = false;
- /**
- * The assignment context of this node. See {@link AssignmentContext}.
- */
+ /** The assignment context of this node. See {@link AssignmentContext}. */
protected /*@Nullable*/ AssignmentContext assignmentContext;
/**
- * Does this node represent a tree that appears in the source code (true)
- * or one that the CFG builder added while desugaring (false).
+ * Does this node represent a tree that appears in the source code (true) or one that the CFG
+ * builder added while desugaring (false).
*/
protected boolean inSource = true;
/**
- * The type of this node. For {@link Node}s with {@link Tree}s, this type is
- * the type of the {@link Tree}. Otherwise, it is the type is set by the
- * {@link CFGBuilder}.
+ * The type of this node. For {@link Node}s with {@link Tree}s, this type is the type of the
+ * {@link Tree}. Otherwise, it is the type is set by the {@link CFGBuilder}.
*/
protected final TypeMirror type;
@@ -74,8 +59,8 @@ public abstract class Node {
}
/**
- * @return The basic block this node belongs to (or {@code null} if it
- * represents the parameter of a method).
+ * @return the basic block this node belongs to (or {@code null} if it represents the parameter
+ * of a method).
*/
public /*@Nullable*/ Block getBlock() {
return block;
@@ -87,19 +72,18 @@ public abstract class Node {
}
/**
- * Returns the {@link Tree} in the abstract syntax tree, or
- * <code>null</code> if no corresponding tree exists. For instance, this is
- * the case for an {@link ImplicitThisLiteralNode}.
+ * Returns the {@link Tree} in the abstract syntax tree, or {@code null} if no corresponding
+ * tree exists. For instance, this is the case for an {@link ImplicitThisLiteralNode}.
*
- * @return The corresponding {@link Tree} or <code>null</code>.
+ * @return the corresponding {@link Tree} or {@code null}.
*/
- abstract public /*@Nullable*/ Tree getTree();
+ public abstract /*@Nullable*/ Tree getTree();
/**
- * Returns a {@link TypeMirror} representing the type of a {@link Node} A
- * {@link Node} will always have a type even when it has no {@link Tree}.
+ * Returns a {@link TypeMirror} representing the type of a {@link Node} A {@link Node} will
+ * always have a type even when it has no {@link Tree}.
*
- * @return A {@link TypeMirror} representing the type of this {@link Node}.
+ * @return a {@link TypeMirror} representing the type of this {@link Node}
*/
public TypeMirror getType() {
return type;
@@ -108,14 +92,10 @@ public abstract class Node {
/**
* Accept method of the visitor pattern
*
- * @param <R>
- * Result type of the operation.
- * @param <P>
- * Parameter type.
- * @param visitor
- * The visitor to be applied to this node.
- * @param p
- * The parameter for this operation.
+ * @param <R> result type of the operation
+ * @param <P> parameter type
+ * @param visitor the visitor to be applied to this node
+ * @param p the parameter for this operation
*/
public abstract <R, P> R accept(NodeVisitor<R, P> visitor, P p);
@@ -123,9 +103,7 @@ public abstract class Node {
return lvalue;
}
- /**
- * Make this node an l-value.
- */
+ /** Make this node an l-value. */
public void setLValue() {
lvalue = true;
}
@@ -146,16 +124,12 @@ public abstract class Node {
this.assignmentContext = assignmentContext;
}
- /**
- * @return A collection containing all of the operand {@link Node}s of this
- * {@link Node}.
- */
+ /** @return a collection containing all of the operand {@link Node}s of this {@link Node}. */
public abstract Collection<Node> getOperands();
/**
- * @return A collection containing all of the operand {@link Node}s of this
- * {@link Node}, as well as (transitively) the operands of its
- * operands.
+ * @return a collection containing all of the operand {@link Node}s of this {@link Node}, as
+ * well as (transitively) the operands of its operands
*/
public Collection<Node> getTransitiveOperands() {
LinkedList<Node> operands = new LinkedList<>(getOperands());
@@ -167,5 +141,4 @@ public abstract class Node {
}
return transitiveOperands;
}
-
}