]> source.dussan.org Git - jackcess.git/commitdiff
fix toString for Entry
authorJames Ahlborn <jtahlborn@yahoo.com>
Thu, 6 Mar 2008 20:32:46 +0000 (20:32 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Thu, 6 Mar 2008 20:32:46 +0000 (20:32 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@250 f203690c-595d-4dc9-a70b-905162fa7fd2

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

index 577f4de076225b756201a4ff7cee2c41ba81c213..df9fb048a3493b77bb7e13a2cde714d18c8baad2 100644 (file)
@@ -1216,15 +1216,16 @@ public class Index implements Comparable<Index> {
                            ByteOrder.BIG_ENDIAN);
       buffer.put((byte)getRowId().getRowNumber());
     }
+
+    protected final String entryBytesToString() {
+      return (isValid() ? ", Bytes = " + ByteUtil.toHexString(
+                  ByteBuffer.wrap(_entryBytes), _entryBytes.length) :
+              "");
+    }
     
     @Override
     public String toString() {
-      String entryStr = (isValid() ?
-                         ", Bytes = " +
-                         ByteUtil.toHexString(ByteBuffer.wrap(_entryBytes),
-                                              _entryBytes.length) :
-                         "");
-      return "RowId = " + _rowId + entryStr + "\n";
+      return "RowId = " + _rowId + entryBytesToString() + "\n";
     }
 
     @Override
@@ -1326,10 +1327,7 @@ public class Index implements Comparable<Index> {
     @Override
     public String toString() {
       return ("Node RowId = " + getRowId() +
-              ", SubPage = " + _subPageNumber +
-              ", Bytes = " +
-              ByteUtil.toHexString(ByteBuffer.wrap(getEntryBytes()),
-                                   getEntryBytes().length) + "\n");
+              ", SubPage = " + _subPageNumber + entryBytesToString() + "\n");
     }
         
   }