3.x RC1 compatibility
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / AstNode.java
index da77815..e4ccbbb 100644 (file)
@@ -1,7 +1,6 @@
 package net.sourceforge.phpdt.internal.compiler.ast;
 
 import java.util.List;
-import java.util.ArrayList;
 
 /**
  * It will be the mother of our own ast tree for php just like the ast tree of Eclipse.
@@ -12,12 +11,15 @@ public abstract class AstNode {
   /** Starting and ending position of the node in the sources. */
   public int sourceStart, sourceEnd;
 
+       protected AstNode() {
+               super();
+       }
   /**
-   * Create a node giving starting and ending offset
+   * Create a node giving starting and ending offset.
    * @param sourceStart starting offset
    * @param sourceEnd ending offset
    */
-  public AstNode(final int sourceStart, final int sourceEnd) {
+  protected AstNode(final int sourceStart, final int sourceEnd) {
     this.sourceStart = sourceStart;
     this.sourceEnd = sourceEnd;
   }
@@ -53,16 +55,19 @@ public abstract class AstNode {
 
   /**
    * Get the variables from outside (parameters, globals ...)
+   * @param list the list where we will put variables
    */
   public abstract void getOutsideVariable(List list);
 
   /**
    * get the modified variables.
+   * @param list the list where we will put variables
    */
   public abstract void getModifiedVariable(List list);
 
   /**
    * Get the variables used.
+   * @param list the list where we will put variables
    */
   public abstract void getUsedVariable(List list);
 
@@ -70,16 +75,15 @@ public abstract class AstNode {
    * This method will analyze the code.
    * by default it will do nothing
    */
-  public void analyzeCode() {
-  }
+  public void analyzeCode() {}
 
   /**
-   * Check if the array array contains the object o
+   * Check if the array array contains the object o.
    * @param array an array
    * @param o an obejct
    * @return true if the array contained the object o
    */
-  public boolean arrayContains(Object[] array, Object o) {
+  public final boolean arrayContains(final Object[] array, final Object o) {
     for (int i = 0; i < array.length; i++) {
       if (array[i].equals(o)) {
         return true;