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 / ArrayVariableDeclaration.java
index 9e62673..4a306e6 100644 (file)
@@ -22,7 +22,7 @@ public class ArrayVariableDeclaration extends Expression {
    * @param value the value
    */
   public ArrayVariableDeclaration(final Expression key, final Expression value) {
-    super(key.getSourceStart(), value.getSourceEnd());
+    super(key.sourceStart, value.sourceEnd);
     this.key = key;
     this.value = value;
   }
@@ -33,7 +33,7 @@ public class ArrayVariableDeclaration extends Expression {
    * @param sourceEnd the end position
    */
   public ArrayVariableDeclaration(final Expression key, final int sourceEnd) {
-    super(key.getSourceStart(), sourceEnd);
+    super(key.sourceStart, sourceEnd);
     this.key = key;
   }
 
@@ -54,34 +54,27 @@ public class ArrayVariableDeclaration extends Expression {
 
   /**
    * Get the variables from outside (parameters, globals ...)
-   * @return the variables from outside
    */
-  public List getOutsideVariable() {
-    return new ArrayList();
+  public void getOutsideVariable(final List list) {
   }
 
   /**
    * get the modified variables.
-   * @return the variables from we change value
    */
-  public List getModifiedVariable() {
-    final ArrayList list = new ArrayList();
-    list.addAll(key.getModifiedVariable());
+  public void getModifiedVariable(final List list) {
+    key.getModifiedVariable(list);
     if (value != null) {
-      list.addAll(value.getModifiedVariable());
+      value.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) {
+    key.getUsedVariable(list);
     if (value != null) {
-      list.addAll(value.getUsedVariable());
+      value.getUsedVariable(list);
     }
-    return list;
   }
 }