Changes:
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / IfStatement.java
index cb6c88b..824b721 100644 (file)
@@ -1,7 +1,6 @@
 package net.sourceforge.phpdt.internal.compiler.ast;
 
 import java.util.List;
-import java.util.ArrayList;
 
 /**
  * This is a if statement.
@@ -65,58 +64,49 @@ public class IfStatement extends Statement {
 
   /**
    * Get the variables from outside (parameters, globals ...)
-   * @return the variables from outside
    */
-  public List getOutsideVariable() {
-    final ArrayList list = new ArrayList();
-    list.addAll(condition.getOutsideVariable()); // todo: check if unuseful
+  public void getOutsideVariable(final List list) {
+    condition.getOutsideVariable(list); // todo: check if unuseful
     if (statement != null) {
-      list.addAll(statement.getOutsideVariable());
+      statement.getOutsideVariable(list);
     }
     for (int i = 0; i < elseifs.length; i++) {
-      list.addAll(elseifs[i].getOutsideVariable());
+      elseifs[i].getOutsideVariable(list);
     }
     if (els != null) {
-      list.addAll(els.getOutsideVariable());
+      els.getOutsideVariable(list);
     }
-    return list;
   }
 
   /**
    * get the modified variables.
-   * @return the variables from we change value
    */
-  public List getModifiedVariable() {
-    final ArrayList list = new ArrayList();
-    list.addAll(condition.getModifiedVariable());
+  public void getModifiedVariable(final List list) {
+    condition.getModifiedVariable(list);
     if (statement != null) {
-      list.addAll(statement.getModifiedVariable());
+      statement.getModifiedVariable(list);
     }
     for (int i = 0; i < elseifs.length; i++) {
-      list.addAll(elseifs[i].getModifiedVariable());
+      elseifs[i].getModifiedVariable(list);
     }
     if (els != null) {
-      list.addAll(els.getModifiedVariable());
+      els.getModifiedVariable(list);
     }
-    return list;
   }
 
   /**
    * Get the variables used.
-   * @return the variables used
    */
-  public List getUsedVariable() {
-    final ArrayList list = new ArrayList();
-    list.addAll(condition.getUsedVariable());
+  public void getUsedVariable(final List list) {
+    condition.getUsedVariable(list);
     if (statement != null) {
-      list.addAll(statement.getUsedVariable());
+      statement.getUsedVariable(list);
     }
     for (int i = 0; i < elseifs.length; i++) {
-      list.addAll(elseifs[i].getUsedVariable());
+      elseifs[i].getUsedVariable(list);
     }
     if (els != null) {
-      list.addAll(els.getUsedVariable());
+      els.getUsedVariable(list);
     }
-    return list;
   }
 }