import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
import net.sourceforge.phpdt.internal.ui.PHPUiImages;
+import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.jface.resource.ImageDescriptor;
import java.util.ArrayList;
public int bodyStart;
public int bodyEnd;
/** The methods of the class. */
- private ArrayList methods = new ArrayList();
+ private final ArrayList methods = new ArrayList();
/** The constructor of the class. */
public MethodDeclaration constructor;
/** The fields of the class. */
this.superclass = superclass;
}
- /**
+ /**
* Create a class giving starting and ending offset
* @param sourceStart starting offset
* @param sourceEnd ending offset
}
public void addMethod(MethodDeclaration method) {
- method.add(method);
+ methods.add(method);
children.add(method);
if (method.name.equals(name)) {
constructor = method;
buff.append(";");//$NON-NLS-1$
}
}
- if (methods != null) {
- for (int i = 0; i < methods.size(); i++) {
- MethodDeclaration o = (MethodDeclaration) methods.get(i);
- buff.append("\n");//$NON-NLS-1$
- buff.append(o.toString(tab + 1));
- }
+ for (int i = 0; i < methods.size(); i++) {
+ MethodDeclaration o = (MethodDeclaration) methods.get(i);
+ buff.append("\n");//$NON-NLS-1$
+ buff.append(o.toString(tab + 1));
}
buff.append("\n").append(tabString(tab)).append("}"); //$NON-NLS-2$ //$NON-NLS-1$
return buff.toString();
* @return the header of the class
*/
public String toStringHeader() {
- final StringBuffer buff = new StringBuffer("class").append(name);//$NON-NLS-1$
+ final StringBuffer buff = new StringBuffer("class ").append(name);//$NON-NLS-1$
if (superclass != null) {
buff.append(" extends "); //$NON-NLS-1$
buff.append(superclass);