diff options
author | 2017-10-15 23:31:56 -0700 | |
---|---|---|
committer | 2017-10-16 14:16:39 +0200 | |
commit | 6bf3f268f4a01963a2ee13f60178664bb056a802 (patch) | |
tree | 32a870dc293e07af88f52b241c75d9cbd462f63f /third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block | |
parent | 80a34dc97799961201e6dce20fd58dd08022c032 (diff) |
Update checker framework dataflow and javacutils to 2.1.14
Change-Id: I62ad827fc4bbd54d022097003af63e351e44b98c
Diffstat (limited to 'third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block')
12 files changed, 51 insertions, 144 deletions
diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/Block.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/Block.java index 81edef6b2d..2d58550568 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/Block.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/Block.java @@ -4,7 +4,6 @@ package org.checkerframework.dataflow.cfg.block; * Represents a basic block in a control flow graph. * * @author Stefan Heule - * */ public interface Block { @@ -24,14 +23,9 @@ public interface Block { EXCEPTION_BLOCK, } - /** - * @return The type of this basic block. - */ + /** @return the type of this basic block */ BlockType getType(); - /** - * @return The unique identifier of this block. - */ + /** @return the unique identifier of this block */ long getId(); - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/BlockImpl.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/BlockImpl.java index c3df418ecc..0421a1e3f5 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/BlockImpl.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/BlockImpl.java @@ -6,9 +6,8 @@ import java.util.Set; /** * Base class of the {@link Block} implementation hierarchy. - * + * * @author Stefan Heule - * */ public abstract class BlockImpl implements Block { @@ -24,9 +23,7 @@ public abstract class BlockImpl implements Block { /** The set of predecessors. */ protected Set<BlockImpl> predecessors; - /** - * @return A fresh identifier. - */ + /** @return a fresh identifier */ private static long uniqueID() { return lastId++; } @@ -45,9 +42,7 @@ public abstract class BlockImpl implements Block { return type; } - /** - * @return The list of predecessors of this basic block. - */ + /** @return the list of predecessors of this basic block */ public Set<BlockImpl> getPredecessors() { return Collections.unmodifiableSet(predecessors); } @@ -59,5 +54,4 @@ public abstract class BlockImpl implements Block { public void removePredecessor(BlockImpl pred) { predecessors.remove(pred); } - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlock.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlock.java index d267c99803..dce04abdfe 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlock.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlock.java @@ -4,45 +4,27 @@ import org.checkerframework.dataflow.analysis.Store; import org.checkerframework.dataflow.cfg.node.Node; /** - * Represents a conditional basic block that contains exactly one boolean - * {@link Node}. + * Represents a conditional basic block that contains exactly one boolean {@link Node}. * * @author Stefan Heule - * */ public interface ConditionalBlock extends Block { - /** - * @return The entry block of the then branch. - */ + /** @return the entry block of the then branch */ Block getThenSuccessor(); - /** - * @return The entry block of the else branch. - */ + /** @return the entry block of the else branch */ Block getElseSuccessor(); - /** - * @return The flow rule for information flowing from - * this block to its then successor. - */ + /** @return the flow rule for information flowing from this block to its then successor */ Store.FlowRule getThenFlowRule(); - /** - * @return The flow rule for information flowing from - * this block to its else successor. - */ + /** @return the flow rule for information flowing from this block to its else successor */ Store.FlowRule getElseFlowRule(); - /** - * Set the flow rule for information flowing from this block to - * its then successor. - */ + /** Set the flow rule for information flowing from this block to its then successor. */ void setThenFlowRule(Store.FlowRule rule); - /** - * Set the flow rule for information flowing from this block to - * its else successor. - */ + /** Set the flow rule for information flowing from this block to its else successor. */ void setElseFlowRule(Store.FlowRule rule); } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlockImpl.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlockImpl.java index 629bb81070..bd12522983 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlockImpl.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ConditionalBlockImpl.java @@ -6,7 +6,6 @@ import org.checkerframework.dataflow.analysis.Store; * Implementation of a conditional basic block. * * @author Stefan Heule - * */ public class ConditionalBlockImpl extends BlockImpl implements ConditionalBlock { @@ -17,34 +16,29 @@ public class ConditionalBlockImpl extends BlockImpl implements ConditionalBlock protected BlockImpl elseSuccessor; /** - * The rules below say that the THEN store before a conditional - * block flows to BOTH of the stores of the then successor, while - * the ELSE store before a conditional block flows to BOTH of the - * stores of the else successor. + * The rules below say that the THEN store before a conditional block flows to BOTH of the + * stores of the then successor, while the ELSE store before a conditional block flows to BOTH + * of the stores of the else successor. */ protected Store.FlowRule thenFlowRule = Store.FlowRule.THEN_TO_BOTH; - + protected Store.FlowRule elseFlowRule = Store.FlowRule.ELSE_TO_BOTH; /** - * Initialize an empty conditional basic block to be filled with contents - * and linked to other basic blocks later. + * Initialize an empty conditional basic block to be filled with contents and linked to other + * basic blocks later. */ public ConditionalBlockImpl() { type = BlockType.CONDITIONAL_BLOCK; } - /** - * Set the then branch successor. - */ + /** Set the then branch successor. */ public void setThenSuccessor(BlockImpl b) { thenSuccessor = b; b.addPredecessor(this); } - /** - * Set the else branch successor. - */ + /** Set the else branch successor. */ public void setElseSuccessor(BlockImpl b) { elseSuccessor = b; b.addPredecessor(this); diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlock.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlock.java index c00a7e1e34..a549c5f03f 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlock.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlock.java @@ -2,37 +2,26 @@ package org.checkerframework.dataflow.cfg.block; import java.util.Map; import java.util.Set; - import javax.lang.model.type.TypeMirror; - import org.checkerframework.dataflow.cfg.node.Node; /** - * Represents a basic block that contains exactly one {@link Node} which can - * throw an exception. This block has exactly one non-exceptional successor, and - * one or more exceptional successors. - * - * <p> + * Represents a basic block that contains exactly one {@link Node} which can throw an exception. + * This block has exactly one non-exceptional successor, and one or more exceptional successors. * - * The following invariant holds. + * <p>The following invariant holds. * * <pre> * getNode().getBlock() == this * </pre> * * @author Stefan Heule - * */ public interface ExceptionBlock extends SingleSuccessorBlock { - /** - * @return The node of this block. - */ + /** @return the node of this block */ Node getNode(); - /** - * @return The list of exceptional successor blocks as an unmodifiable map. - */ + /** @return the list of exceptional successor blocks as an unmodifiable map */ Map<TypeMirror, Set<Block>> getExceptionalSuccessors(); - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlockImpl.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlockImpl.java index 2148e060cd..2a6c3b4914 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlockImpl.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/ExceptionBlockImpl.java @@ -5,19 +5,15 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; - import javax.lang.model.type.TypeMirror; - import org.checkerframework.dataflow.cfg.node.Node; /** * Base class of the {@link Block} implementation hierarchy. * * @author Stefan Heule - * */ -public class ExceptionBlockImpl extends SingleSuccessorBlockImpl implements - ExceptionBlock { +public class ExceptionBlockImpl extends SingleSuccessorBlockImpl implements ExceptionBlock { /** Set of exceptional successors. */ protected Map<TypeMirror, Set<Block>> exceptionalSuccessors; @@ -30,9 +26,7 @@ public class ExceptionBlockImpl extends SingleSuccessorBlockImpl implements /** The node of this block. */ protected Node node; - /** - * Set the node. - */ + /** Set the node. */ public void setNode(Node c) { node = c; c.setBlock(this); @@ -43,11 +37,8 @@ public class ExceptionBlockImpl extends SingleSuccessorBlockImpl implements return node; } - /** - * Add an exceptional successor. - */ - public void addExceptionalSuccessor(BlockImpl b, - TypeMirror cause) { + /** Add an exceptional successor. */ + public void addExceptionalSuccessor(BlockImpl b, TypeMirror cause) { if (exceptionalSuccessors == null) { exceptionalSuccessors = new HashMap<>(); } @@ -72,5 +63,4 @@ public class ExceptionBlockImpl extends SingleSuccessorBlockImpl implements public String toString() { return "ExceptionBlock(" + node + ")"; } - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlock.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlock.java index dd6502fa1a..566449257b 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlock.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlock.java @@ -1,38 +1,27 @@ package org.checkerframework.dataflow.cfg.block; import java.util.List; - import org.checkerframework.dataflow.cfg.node.Node; /** * A regular basic block that contains a sequence of {@link Node}s. * - * <p> - * - * The following invariant holds. + * <p>The following invariant holds. * * <pre> * forall n in getContents() :: n.getBlock() == this * </pre> * * @author Stefan Heule - * */ public interface RegularBlock extends SingleSuccessorBlock { - /** - * @return The unmodifiable sequence of {@link Node}s. - */ + /** @return the unmodifiable sequence of {@link Node}s. */ List<Node> getContents(); - /** - * @return The regular successor block. - */ + /** @return the regular successor block */ Block getRegularSuccessor(); - /** - * Is this block empty (i.e., does it not contain any contents). - */ + /** Is this block empty (i.e., does it not contain any contents). */ boolean isEmpty(); - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlockImpl.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlockImpl.java index 853f2c94f0..b302710d70 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlockImpl.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/RegularBlockImpl.java @@ -3,41 +3,34 @@ package org.checkerframework.dataflow.cfg.block; import java.util.Collections; import java.util.LinkedList; import java.util.List; - import org.checkerframework.dataflow.cfg.node.Node; /** * Implementation of a regular basic block. * * @author Stefan Heule - * */ -public class RegularBlockImpl extends SingleSuccessorBlockImpl implements - RegularBlock { +public class RegularBlockImpl extends SingleSuccessorBlockImpl implements RegularBlock { /** Internal representation of the contents. */ protected List<Node> contents; /** - * Initialize an empty basic block to be filled with contents and linked to - * other basic blocks later. + * Initialize an empty basic block to be filled with contents and linked to other basic blocks + * later. */ public RegularBlockImpl() { contents = new LinkedList<>(); type = BlockType.REGULAR_BLOCK; } - /** - * Add a node to the contents of this basic block. - */ + /** Add a node to the contents of this basic block. */ public void addNode(Node t) { contents.add(t); t.setBlock(this); } - /** - * Add multiple nodes to the contents of this basic block. - */ + /** Add multiple nodes to the contents of this basic block. */ public void addNodes(List<? extends Node> ts) { for (Node t : ts) { addNode(t); @@ -63,5 +56,4 @@ public class RegularBlockImpl extends SingleSuccessorBlockImpl implements public boolean isEmpty() { return contents.isEmpty(); } - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlock.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlock.java index 4d56291fe6..038a69d3e4 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlock.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlock.java @@ -10,23 +10,15 @@ import org.checkerframework.dataflow.analysis.Store; * A basic block that has at exactly one non-exceptional successor. * * @author Stefan Heule - * */ public interface SingleSuccessorBlock extends Block { - /** - * @return The non-exceptional successor block, or {@code null} if there is - * no successor. - */ + /** @return the non-exceptional successor block, or {@code null} if there is no successor. */ /*@Nullable*/ Block getSuccessor(); - /** - * @return The flow rule for information flowing from this block to its successor. - */ + /** @return the flow rule for information flowing from this block to its successor */ Store.FlowRule getFlowRule(); - /** - * Set the flow rule for information flowing from this block to its successor. - */ + /** Set the flow rule for information flowing from this block to its successor. */ void setFlowRule(Store.FlowRule rule); } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlockImpl.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlockImpl.java index 7e5988e2e7..9e8872e850 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlockImpl.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SingleSuccessorBlockImpl.java @@ -10,17 +10,15 @@ import org.checkerframework.dataflow.analysis.Store; * Implementation of a non-special basic block. * * @author Stefan Heule - * */ -public abstract class SingleSuccessorBlockImpl extends BlockImpl implements - SingleSuccessorBlock { +public abstract class SingleSuccessorBlockImpl extends BlockImpl implements SingleSuccessorBlock { /** Internal representation of the successor. */ protected /*@Nullable*/ BlockImpl successor; /** - * The rule below say that EACH store at the end of a single - * successor block flow to the corresponding store of the successor. + * The rule below say that EACH store at the end of a single successor block flow to the + * corresponding store of the successor. */ protected Store.FlowRule flowRule = Store.FlowRule.EACH_TO_EACH; @@ -29,9 +27,7 @@ public abstract class SingleSuccessorBlockImpl extends BlockImpl implements return successor; } - /** - * Set a basic block as the successor of this block. - */ + /** Set a basic block as the successor of this block. */ public void setSuccessor(BlockImpl successor) { this.successor = successor; successor.addPredecessor(this); diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlock.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlock.java index 89154bf604..dac9b4b8c2 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlock.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlock.java @@ -2,14 +2,14 @@ package org.checkerframework.dataflow.cfg.block; /** * Represents a special basic block; i.e., one of the following: + * * <ul> - * <li>Entry block of a method.</li> - * <li>Regular exit block of a method.</li> - * <li>Exceptional exit block of a method.</li> + * <li>Entry block of a method. + * <li>Regular exit block of a method. + * <li>Exceptional exit block of a method. * </ul> * * @author Stefan Heule - * */ public interface SpecialBlock extends SingleSuccessorBlock { @@ -26,9 +26,6 @@ public interface SpecialBlock extends SingleSuccessorBlock { EXCEPTIONAL_EXIT, } - /** - * @return The type of this special basic block. - */ + /** @return the type of this special basic block */ SpecialBlockType getSpecialType(); - } diff --git a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlockImpl.java b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlockImpl.java index 9b3f8fb8e3..e6f25e8b1b 100644 --- a/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlockImpl.java +++ b/third_party/checker_framework_dataflow/java/org/checkerframework/dataflow/cfg/block/SpecialBlockImpl.java @@ -1,7 +1,6 @@ package org.checkerframework.dataflow.cfg.block; -public class SpecialBlockImpl extends SingleSuccessorBlockImpl implements - SpecialBlock { +public class SpecialBlockImpl extends SingleSuccessorBlockImpl implements SpecialBlock { /** The type of this special basic block. */ protected SpecialBlockType specialType; @@ -20,5 +19,4 @@ public class SpecialBlockImpl extends SingleSuccessorBlockImpl implements public String toString() { return "SpecialBlock(" + specialType + ")"; } - } |