public class MethodDeclaration extends Statement implements OutlineableWithChildren {
/** The name of the method. */
- public char[] name;
+ public String name;
public Hashtable arguments;
private Position position;
public MethodDeclaration(final Object parent,
- final char[] name,
+ final String name,
final Hashtable arguments,
final boolean reference,
final int sourceStart,
- final int sourceEnd) {
+ final int sourceEnd,
+ final int bodyStart,
+ final int bodyEnd) {
super(sourceStart, sourceEnd);
this.name = name;
this.arguments = arguments;
this.parent = parent;
this.reference = reference;
+ this.bodyStart = bodyStart;
+ this.bodyEnd = bodyEnd;
position = new Position(sourceStart, sourceEnd);
}
private void findUnknownUsedVars(final List usedVars, final List declaredVars) {
for (int i = 0; i < usedVars.size(); i++) {
VariableUsage variableUsage = (VariableUsage) usedVars.get(i);
+ if (variableUsage.getName().equals("this")) continue; // this is a special variable
if (!isVariableDeclaredBefore(declaredVars, variableUsage)) {
try {
- PHPeclipsePlugin.log(1,variableUsage.getName()+" "+variableUsage.getStartOffset());
PHPParserSuperclass.setMarker("warning, usage of an unknown variable : " + variableUsage.getName(),
variableUsage.getStartOffset(),
variableUsage.getStartOffset() + variableUsage.getName().length(),