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 / HTMLBlock.java
index 27d93fa..2d40de1 100644 (file)
@@ -11,7 +11,7 @@ public class HTMLBlock extends Statement {
   public AstNode[] nodes;
 
   public HTMLBlock(final AstNode[] nodes) {
-    super(nodes[0].sourceStart, nodes[nodes.length-1].sourceEnd);
+    super(nodes[0].sourceStart, nodes[(nodes.length > 0) ? nodes.length - 1 : 0].sourceEnd);
     this.nodes = nodes;
   }
 
@@ -24,7 +24,7 @@ public class HTMLBlock extends Statement {
     final StringBuffer buff = new StringBuffer(tabString(tab));
     buff.append("?>");
     for (int i = 0; i < nodes.length; i++) {
-      buff.append(nodes[i].toString(tab +1));
+      buff.append(nodes[i].toString(tab + 1));
     }
     buff.append("<?php\n");
     return buff.toString();
@@ -32,25 +32,19 @@ public class HTMLBlock extends Statement {
 
   /**
    * Get the variables from outside (parameters, globals ...)
-   * @return an empty list
    */
-  public List getOutsideVariable() {
-    return new ArrayList();
+  public void getOutsideVariable(final List list) {
   }
 
   /**
    * get the modified variables.
-   * @return an empty list
    */
-  public List getModifiedVariable() {
-    return new ArrayList();
+  public void getModifiedVariable(final List list) {
   }
 
   /**
    * Get the variables used.
-   * @return an empty list
    */
-  public List getUsedVariable() {
-    return new ArrayList();
+  public void getUsedVariable(final List list) {
   }
 }