diff --git a/spoon-control-flow/src/main/java/fr/inria/controlflow/AllBranchesReturn.java b/spoon-control-flow/src/main/java/fr/inria/controlflow/AllBranchesReturn.java index 68a84960711..cf79624aaf9 100644 --- a/spoon-control-flow/src/main/java/fr/inria/controlflow/AllBranchesReturn.java +++ b/spoon-control-flow/src/main/java/fr/inria/controlflow/AllBranchesReturn.java @@ -30,7 +30,7 @@ /** * 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 - *
+ * * Created by marodrig on 04/01/2016. */ public class AllBranchesReturn { @@ -38,7 +38,7 @@ 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) { diff --git a/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowBuilder.java b/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowBuilder.java index 73332d3e11a..de5c091f779 100644 --- a/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowBuilder.java +++ b/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowBuilder.java @@ -116,7 +116,7 @@ /** * Builds the control graph for a given snippet of code - * + * * Created by marodrig on 13/10/2015. */ public class ControlFlowBuilder implements CtVisitor { @@ -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); @@ -179,13 +179,14 @@ private void visitConditional(CtElement parent, CtConditional conditional) { /** * Returns the first graph node representing the statement s construction. - * + * * 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 { @@ -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()) { diff --git a/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowGraph.java b/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowGraph.java index 35fb3bb253b..86a617a9f68 100644 --- a/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowGraph.java +++ b/spoon-control-flow/src/main/java/fr/inria/controlflow/ControlFlowGraph.java @@ -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 { @@ -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) { @@ -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* 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. - *
+ * * Created by marodrig on 13/11/2015. */ public class InitializedVariables { diff --git a/spoon-control-flow/src/main/java/fr/inria/dataflow/UselessAssignmentAnalysis.java b/spoon-control-flow/src/main/java/fr/inria/dataflow/UselessAssignmentAnalysis.java index 20e32669889..8a362c5d3af 100644 --- a/spoon-control-flow/src/main/java/fr/inria/dataflow/UselessAssignmentAnalysis.java +++ b/spoon-control-flow/src/main/java/fr/inria/dataflow/UselessAssignmentAnalysis.java @@ -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) - * + ** Return the list of useless assignments - *
+ * * Created by marodrig on 03/02/2016. */ public class UselessAssignmentAnalysis { @@ -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 { @@ -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