X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java index d2371be..1f6c9a0 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/Block.java @@ -1,7 +1,6 @@ package net.sourceforge.phpdt.internal.compiler.ast; import java.util.List; -import java.util.ArrayList; /** * A Block. @@ -10,10 +9,10 @@ import java.util.ArrayList; * }. * @author Matthieu Casanova */ -public class Block extends Statement { +public final class Block extends Statement { /** An array of statements inside the block. */ - public Statement[] statements; + public final Statement[] statements; /** * Create a block. @@ -45,7 +44,7 @@ public class Block extends Statement { final String s = AstNode.tabString(tab); final StringBuffer buff = new StringBuffer(s); buff.append("{\n"); //$NON-NLS-1$ - if (this.statements != null) { + if (statements != null) { for (int i = 0; i < statements.length; i++) { buff.append(statements[i].toString(tab + 1)).append(";\n");//$NON-NLS-1$ } @@ -56,37 +55,34 @@ public class Block extends Statement { /** * Get the variables from outside (parameters, globals ...) - * @return the variables from outside + * + * @param list the list where we will put variables */ - public List getOutsideVariable() { - final ArrayList list = new ArrayList(); + public void getOutsideVariable(final List list) { for (int i = 0; i < statements.length; i++) { - list.addAll(statements[i].getOutsideVariable()); + statements[i].getOutsideVariable(list); } - return list; } /** * get the modified variables. - * @return the variables from we change value + * + * @param list the list where we will put variables */ - public List getModifiedVariable() { - final ArrayList list = new ArrayList(); + public void getModifiedVariable(final List list) { for (int i = 0; i < statements.length; i++) { - list.addAll(statements[i].getModifiedVariable()); + statements[i].getModifiedVariable(list); } - return list; } /** * Get the variables used. - * @return the variables used + * + * @param list the list where we will put variables */ - public List getUsedVariable() { - final ArrayList list = new ArrayList(); + public void getUsedVariable(final List list) { for (int i = 0; i < statements.length; i++) { - list.addAll(statements[i].getUsedVariable()); + statements[i].getUsedVariable(list); } - return list; } }