Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(spoon-control-flow): fix javadoc errors #2916

Merged
merged 2 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
/**
* An algorithm that takes a CtElement, builds a graph for it and checks that all branches return
* something or that there is no branch returns anything
* <p/>
*
* Created by marodrig on 04/01/2016.
*/
public class AllBranchesReturn {

/**
* Finds if all branches returns
*
* @param element
* @param element starting point
* @return True if all branches return or none return
*/
public boolean execute(CtElement element) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

/**
* Builds the control graph for a given snippet of code
* <p/>
*
* Created by marodrig on 13/10/2015.
*/
public class ControlFlowBuilder implements CtVisitor {
Expand All @@ -143,8 +143,8 @@ public ControlFlowGraph getResult() {
/**
* Build the control graph
*
* @param s
* @return
* @param s starting point
* @return control flow graph
*/
public ControlFlowGraph build(CtElement s) {
s.accept(this);
Expand Down Expand Up @@ -179,13 +179,14 @@ private void visitConditional(CtElement parent, CtConditional conditional) {

/**
* Returns the first graph node representing the statement s construction.
* <p/>
*
* Usually an statement is represented by many blocks and branches.
* This method returns the first of those blocks/branches.
*
* @param g Graph in which the bloc is to be found
* @param statement Statement for which the first block is needed
* @return
* @return first graph node
* @throws NotFoundException when the initial node cannot be found
*/
public static ControlFlowNode firstNode(ControlFlowGraph g, CtElement statement) throws NotFoundException {

Expand Down Expand Up @@ -238,7 +239,6 @@ private void defaultAction(BranchKind kind, CtStatement st) {
/**
* Register the label of the statement
*
* @param st
*/
private void registerStatementLabel(CtStatement st) {
if (st.getLabel() == null || st.getLabel().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public String toGraphVisText() {
/**
* Find the node holding and element
*
* @param e
* @param e node to find
* @return
*/
public ControlFlowNode findNode(CtElement e) throws NotFoundException {
Expand All @@ -82,7 +82,7 @@ public ControlFlowNode findNode(CtElement e) throws NotFoundException {

/**
* Find nodes by a given id
* @param id
* @param id of the node to find
* @return
*/
public ControlFlowNode findNodeById(int id) {
Expand All @@ -97,8 +97,8 @@ public ControlFlowNode findNodeById(int id) {
/**
* Find all nodes of a given kind
*
* @param kind
* @return
* @param kind of node to find
* @return list of nodes
*/
public List<ControlFlowNode> findNodesOfKind(BranchKind kind) {
ArrayList<ControlFlowNode> result = new ArrayList<ControlFlowNode>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

/**
* A node of the control flow
* <p/>
* <p/>
*
* Created by marodrig on 13/10/2015.
*/
public class ControlFlowNode {
Expand Down Expand Up @@ -88,8 +87,6 @@ public ControlFlowNode(CtElement statement, ControlFlowGraph parent) {

/**
* Performs the transfer using a given visitor
*
* @param visitor
*/
public void transfer(TransferFunctionVisitor visitor) {
this.visitor = visitor;
Expand All @@ -114,8 +111,6 @@ public int getId() {

/**
* Obtains the siblings of a control node. Siblings are the nodes in parallel branches
*
* @return
*/
public List<ControlFlowNode> siblings() {
ArrayList<ControlFlowNode> result = new ArrayList<ControlFlowNode>();
Expand All @@ -131,8 +126,6 @@ public List<ControlFlowNode> siblings() {

/**
* List of nodes that can be executed just after this one
*
* @return
*/
public List<ControlFlowNode> next() {
ArrayList<ControlFlowNode> result = new ArrayList<ControlFlowNode>();
Expand All @@ -144,8 +137,6 @@ public List<ControlFlowNode> next() {

/**
* List of nodes that could be executed just before this one
*
* @return
*/
public List<ControlFlowNode> prev() {
ArrayList<ControlFlowNode> result = new ArrayList<ControlFlowNode>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.HashMap;
/**
* Prints the control flow in .Dot for GraphVis to visualize
* <p/>
*
* Created by marodrig on 14/10/2015.
*/
public class GraphVisPrettyPrinter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ public void setControlGraph(DirectedGraph<CtStatement, CtStatement> controlGraph

/**
* Output of the last node that called the transfer function
*
* @return
*/
public List<Value> getOutput() {
if (output == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

/**
* Value traveling the data-flow
* <p/>
*
* Created by marodrig on 13/10/2015.
*/
public class Value {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@

/**
* Find initialized variables in a control flow graph.
* <p/>
* <p>
* The algorithms trust that the code from which the graph was created was successfully compiled. That's why
* not only assigned variables are considered initialized, but also used variables.
* <p/>
* </p>
* Created by marodrig on 13/11/2015.
*/
public class InitializedVariables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
/**
* Find useless assignments. A useless assignment is the one assigning to a dead variable.
* (https://en.wikipedia.org/wiki/Live_variable_analysis)
* <p/>
* <p>
* Return the list of useless assignments
* <p/>
* </p>
* Created by marodrig on 03/02/2016.
*/
public class UselessAssignmentAnalysis {
Expand All @@ -52,7 +52,7 @@ public class UselessAssignmentAnalysis {
/**
* The method calculates the control flow for 'container' and then returns the useless assignments
*
* @param container
* @param container to run
* @throws NotFoundException if element 'begin' does not belong to 'container'
*/
public void run(CtElement container) throws NotFoundException {
Expand All @@ -63,7 +63,7 @@ public void run(CtElement container) throws NotFoundException {
/**
* The method calculates the control flow for 'container' and then returns the useless assignments
*
* @param graph
* @param graph to be processed
*/
public void run(ControlFlowGraph graph) {
//This is a backward analysis. So start from the end
Expand Down