]> source.dussan.org Git - jackcess.git/commitdiff
tweak tostring
authorJames Ahlborn <jtahlborn@yahoo.com>
Mon, 14 Apr 2008 02:08:07 +0000 (02:08 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Mon, 14 Apr 2008 02:08:07 +0000 (02:08 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@324 f203690c-595d-4dc9-a70b-905162fa7fd2

src/java/com/healthmarketscience/jackcess/Index.java

index 9e6f19fbf795a7464b4e0a3af0de3e9158fb4b10..9eb3ca1bcb8dd8431f0316946a0c0dc244fe8119 100644 (file)
@@ -2237,8 +2237,10 @@ public abstract class Index implements Comparable<Index> {
       return (isLeaf() ? "Leaf" : "Node") + "DataPage[" + getPageNumber() +
         "] " + getPrevPageNumber() + ", " + getNextPageNumber() + ", (" +
         getChildTailPageNumber() + "), " +
-        (isLeaf() ? ("[" + entries.get(0) + ", " +
-                     entries.get(entries.size() - 1) + "]") : entries);
+        ((isLeaf() && !entries.isEmpty()) ?
+         ("[" + entries.get(0) + ", " +
+          entries.get(entries.size() - 1) + "]") :
+         entries);
     }
   }