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 / DoStatement.java
index f3ee853..9c0689a 100644 (file)
@@ -44,34 +44,25 @@ public class DoStatement 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
-    list.addAll(action.getOutsideVariable());
-    return list;
+  public void getOutsideVariable(final List list) {
+    condition.getOutsideVariable(list); // todo: check if unuseful
+    action.getOutsideVariable(list);
   }
 
   /**
    * get the modified variables.
-   * @return the variables from we change value
    */
-  public List getModifiedVariable() {
-    final ArrayList list = new ArrayList();
-    list.addAll(condition.getModifiedVariable());
-    list.addAll(action.getModifiedVariable());
-    return list;
+  public void getModifiedVariable(final List list) {
+    condition.getModifiedVariable(list);
+    action.getModifiedVariable(list);
   }
 
   /**
    * Get the variables used.
-   * @return the variables used
    */
-  public List getUsedVariable() {
-    final ArrayList list = new ArrayList();
-    list.addAll(condition.getUsedVariable());
-    list.addAll(action.getUsedVariable());
-    return list;
+  public void getUsedVariable(final List list) {
+    condition.getUsedVariable(list);
+    action.getUsedVariable(list);
   }
 }