X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/InclusionStatement.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/InclusionStatement.java index 1cc212c..37d99c1 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/InclusionStatement.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/InclusionStatement.java @@ -11,7 +11,7 @@ import org.eclipse.jface.text.Position; /** * @author Matthieu Casanova */ -public class InclusionStatement extends Statement implements Outlineable { +public final class InclusionStatement extends Statement implements Outlineable { public static final int INCLUDE = 0; public static final int INCLUDE_ONCE = 1; @@ -19,12 +19,12 @@ public class InclusionStatement extends Statement implements Outlineable { public static final int REQUIRE_ONCE = 3; public boolean silent; /** The kind of include. */ - public int keyword; - public Expression expression; + private final int keyword; + private final Expression expression; - private Object parent; + private final Object parent; - private Position position; + private final Position position; public InclusionStatement(final Object parent, final int keyword, @@ -38,7 +38,7 @@ public class InclusionStatement extends Statement implements Outlineable { position = new Position(sourceStart, sourceEnd); } - public String keywordToString() { + private String keywordToString() { switch (keyword) { case INCLUDE: return "include"; //$NON-NLS-1$ @@ -64,13 +64,16 @@ public class InclusionStatement extends Statement implements Outlineable { } public String toString() { - final StringBuffer buffer = new StringBuffer(); + final String keyword = keywordToString(); + final String expressionString = expression.toStringExpression(); + final StringBuffer buffer = new StringBuffer(keyword.length() + + expressionString.length() + 2); if (silent) { buffer.append('@'); } - buffer.append(keywordToString()); - buffer.append(" "); - buffer.append(expression.toStringExpression()); + buffer.append(keyword); + buffer.append(' '); + buffer.append(expressionString); return buffer.toString(); } @@ -92,6 +95,8 @@ public class InclusionStatement extends Statement implements Outlineable { /** * Get the variables from outside (parameters, globals ...) + * + * @param list the list where we will put variables */ public void getOutsideVariable(final List list) { expression.getOutsideVariable(list); @@ -99,6 +104,8 @@ public class InclusionStatement extends Statement implements Outlineable { /** * get the modified variables. + * + * @param list the list where we will put variables */ public void getModifiedVariable(final List list) { expression.getModifiedVariable(list); @@ -106,6 +113,8 @@ public class InclusionStatement extends Statement implements Outlineable { /** * Get the variables used. + * + * @param list the list where we will put variables */ public void getUsedVariable(final List list) { expression.getUsedVariable(list);