From: James Ahlborn Date: Thu, 6 Mar 2008 20:32:46 +0000 (+0000) Subject: fix toString for Entry X-Git-Tag: rel_1_1_13~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=21b3565f0b32606586d3a3bfaed29c5d8c3e32d8;p=jackcess.git fix toString for Entry git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@250 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/Index.java b/src/java/com/healthmarketscience/jackcess/Index.java index 577f4de..df9fb04 100644 --- a/src/java/com/healthmarketscience/jackcess/Index.java +++ b/src/java/com/healthmarketscience/jackcess/Index.java @@ -1216,15 +1216,16 @@ public class Index implements Comparable { 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 { @Override public String toString() { return ("Node RowId = " + getRowId() + - ", SubPage = " + _subPageNumber + - ", Bytes = " + - ByteUtil.toHexString(ByteBuffer.wrap(getEntryBytes()), - getEntryBytes().length) + "\n"); + ", SubPage = " + _subPageNumber + entryBytesToString() + "\n"); } }