Skip to content

Commit 73893b4

Browse files
committed
Bug fix and turned off some debugging output
1 parent d3c79ce commit 73893b4

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/main/java/com/maxmind/maxminddb/Decoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public class Decoder {
1313
private final FileChannel in;
1414

15-
private final boolean DEBUG = true;
15+
private final boolean DEBUG = false;
1616
// XXX - This is only for unit testings. We should possibly make a
1717
// constructor to set this
1818
boolean POINTER_TEST_HACK = false;

src/main/java/com/maxmind/maxminddb/Reader.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Reader {
1414
private static byte METADATE_START_MARKER[] = { (byte) 0xAB, (byte) 0xCD,
1515
(byte) 0xEF, 'M', 'a', 'x', 'M', 'i', 'n', 'd', '.', 'c', 'o', 'm' };
1616

17-
private static final boolean DEBUG = true;
17+
private static final boolean DEBUG = false;
1818
private final Decoder decoder;
1919
private final Metadata metadata;
2020
private final long dataSectionEnd;
@@ -173,7 +173,7 @@ private long[] splitNodeIntoRecords(ByteBuffer bytes)
173173
3));
174174
nodes[1] = Util.decodeLong(Arrays.copyOfRange(bytes.array(), 4,
175175
7));
176-
nodes[0] = ((0xF0 & bytes.get(3)) << 24) | nodes[0];
176+
nodes[0] = ((0xF0 & bytes.get(3)) << 20) | nodes[0];
177177
nodes[1] = ((0x0F & bytes.get(3)) << 24) | nodes[1];
178178
return nodes;
179179
case 32:
@@ -216,13 +216,11 @@ private Object resolveDataPointer(long pointer) throws MaxMindDbException,
216216
*/
217217
private long findMetadataStart() throws IOException {
218218
long fileSize = this.fc.size();
219-
System.out.println(fileSize);
220219

221220
FILE: for (long i = 0; i < fileSize - METADATE_START_MARKER.length + 1; i++) {
222221
for (int j = 0; j < METADATE_START_MARKER.length; j++) {
223222
ByteBuffer b = ByteBuffer.wrap(new byte[1]);
224223
this.fc.read(b, fileSize - i - j - 1);
225-
System.out.println(b.get(0));
226224
if (b.get(0) != METADATE_START_MARKER[METADATE_START_MARKER.length
227225
- j - 1]) {
228226
continue FILE;

0 commit comments

Comments
 (0)