package net.sourceforge.phpdt.internal.compiler.ast;
+import java.util.List;
+
import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
+
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.Position;
-import org.eclipse.core.runtime.CoreException;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
import test.PHPParserSuperclass;
* A GlobalStatement statement in php.
* @author Matthieu Casanova
*/
-public class GlobalStatement extends Statement implements Outlineable {
+public final class GlobalStatement extends Statement implements Outlineable {
/** An array of the variables called by this global statement. */
- public AbstractVariable[] variables;
+ private final AbstractVariable[] variables;
- private Object parent;
+ private final Object parent;
- private Position position;
+ private final Position position;
public GlobalStatement(final Object parent,
final AbstractVariable[] variables,
/**
* Get the variables from outside (parameters, globals ...)
- * @return the variables from outside
+ *
+ * @param list the list where we will put variables
*/
- public List getOutsideVariable() {
- final ArrayList list = new ArrayList(variables.length);
+ public void getOutsideVariable(final List list) {
for (int i = 0; i < variables.length; i++) {
- list.addAll(variables[i].getUsedVariable());
+ variables[i].getUsedVariable(list);
}
- return list;
}
/**
* get the modified variables.
- * @return the variables modified
+ *
+ * @param list the list where we will put variables
*/
- public List getModifiedVariable() {
- return new ArrayList(1);
- }
+ public void getModifiedVariable(final List list) {}
/**
* Get the variables used.
- * @return the variables used
+ *
+ * @param list the list where we will put variables
*/
- public List getUsedVariable() {
- return new ArrayList(1);
- }
+ public void getUsedVariable(final List list) {}
/**
* We will analyse the code.