The methods to get variables do not instantiate ArrayList each time, only one is...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / Block.java
index d2371be..acaf451 100644 (file)
@@ -56,37 +56,28 @@ public class Block extends Statement {
 
   /**
    * Get the variables from outside (parameters, globals ...)
-   * @return the variables from outside
    */
-  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
    */
-  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
    */
-  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;
   }
 }