X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java index cb0b5dd..333e918 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/FunctionCall.java @@ -4,17 +4,21 @@ import java.util.List; import java.util.ArrayList; /** + * A Function call. * @author Matthieu Casanova */ public class FunctionCall extends AbstractSuffixExpression { + /** the function name. */ public Expression prefix; + + /** the arguments. */ public Expression[] args; public FunctionCall(final Expression prefix, final Expression[] args, final int sourceEnd) { - super(prefix.sourceStart, sourceEnd); + super(prefix.getSourceStart(), sourceEnd); this.prefix = prefix; this.args = args; } @@ -39,12 +43,12 @@ public class FunctionCall extends AbstractSuffixExpression { return buff.toString(); } - /** + /** * Get the variables from outside (parameters, globals ...) * @return the variables from outside */ public List getOutsideVariable() { - return new ArrayList(); + return new ArrayList(1); } /** @@ -52,6 +56,9 @@ public class FunctionCall extends AbstractSuffixExpression { * @return the variables from we change value */ public List getModifiedVariable() { + if (args == null) { + return new ArrayList(1); + } final ArrayList list = new ArrayList(); for (int i = 0; i < args.length; i++) { list.addAll(args[i].getModifiedVariable()); @@ -64,10 +71,11 @@ public class FunctionCall extends AbstractSuffixExpression { * @return the variables used */ public List getUsedVariable() { - final ArrayList list = new ArrayList(); - list.addAll(prefix.getUsedVariable()); - for (int i = 0; i < args.length; i++) { - list.addAll(args[i].getUsedVariable()); + final List list = prefix.getUsedVariable(); + if (args != null) { + for (int i = 0; i < args.length; i++) { + list.addAll(args[i].getUsedVariable()); + } } return list; }