*** empty log message ***
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ast / PHPDocument.java
index 41200ae..b2f523d 100644 (file)
@@ -4,6 +4,7 @@ import net.sourceforge.phpdt.internal.compiler.parser.OutlineableWithChildren;
 import net.sourceforge.phpdt.internal.compiler.parser.Outlineable;
 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.Position;
 
 import java.util.ArrayList;
 
@@ -42,13 +43,15 @@ public class PHPDocument implements OutlineableWithChildren {
   public String toString() {
     final StringBuffer buff = new StringBuffer();
     AstNode node;
-    int i;
-    for (i = 0; i < nodes.length; i++) {
-      node = nodes[i];
-      if (node == null) {
-        break;
+    if (nodes != null) {
+      int i;
+      for (i = 0; i < nodes.length; i++) {
+        node = nodes[i];
+        if (node == null) {
+          break;
+        }
+        buff.append(node.toString(0));
       }
-      buff.append(node.toString(0));
     }
     return buff.toString();
   }
@@ -94,4 +97,9 @@ public class PHPDocument implements OutlineableWithChildren {
   public Object getParent() {
     return parent;
   }
+
+  public Position getPosition() {
+    //todo : check this
+    return null;
+  }
 }
\ No newline at end of file