Skip to content

Commit 01c0946

Browse files
committed
Renamed some methods and params
1 parent 73893b4 commit 01c0946

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public class Reader {
2020
private final long dataSectionEnd;
2121
private final FileChannel fc;
2222

23-
public Reader(File dataSource) throws MaxMindDbException, IOException {
23+
public Reader(File database) throws MaxMindDbException, IOException {
2424

25-
RandomAccessFile raf = new RandomAccessFile(dataSource, "r");
25+
RandomAccessFile raf = new RandomAccessFile(database, "r");
2626
this.fc = raf.getChannel();
2727
// XXX - we will want
2828
// MappedByteBuffer in = fc.map(FileChannel.MapMode.READ_ONLY, 0,
@@ -47,7 +47,7 @@ public Reader(File dataSource) throws MaxMindDbException, IOException {
4747
if (start < 0) {
4848
throw new MaxMindDbException(
4949
"Could not find a MaxMind DB metadata marker in this file ("
50-
+ dataSource.getName()
50+
+ database.getName()
5151
+ "). Is this a valid MaxMind DB file?");
5252
}
5353

@@ -68,7 +68,7 @@ public Reader(File dataSource) throws MaxMindDbException, IOException {
6868
}
6969

7070
// FIXME - figure out what we are returning
71-
Object dataForAddress(InetAddress address) throws MaxMindDbException,
71+
public Object get(InetAddress address) throws MaxMindDbException,
7272
IOException {
7373

7474
long pointer = this.findAddressInTree(address);

src/test/java/com/maxmind/maxminddb/ReaderTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private void testIpV4(Reader reader, String fileName)
6464

6565
assertEquals("found expected data record for " + address + " in "
6666
+ fileName, data,
67-
reader.dataForAddress(InetAddress.getByName(address)));
67+
reader.get(InetAddress.getByName(address)));
6868
}
6969

7070
Map<String, String> pairs = new HashMap<String, String>();
@@ -81,11 +81,11 @@ private void testIpV4(Reader reader, String fileName)
8181

8282
assertEquals("found expected data record for " + address + " in "
8383
+ fileName, data,
84-
reader.dataForAddress(InetAddress.getByName(address)));
84+
reader.get(InetAddress.getByName(address)));
8585
}
8686

8787
for (String ip : new String[] { "1.1.1.33", "255.254.253.123" }) {
88-
assertNull(reader.dataForAddress(InetAddress.getByName(ip)));
88+
assertNull(reader.get(InetAddress.getByName(ip)));
8989
}
9090
}
9191

@@ -101,7 +101,7 @@ private void testIpV6(Reader reader, String fileName)
101101

102102
assertEquals("found expected data record for " + address + " in "
103103
+ fileName, data,
104-
reader.dataForAddress(InetAddress.getByName(address)));
104+
reader.get(InetAddress.getByName(address)));
105105
}
106106

107107
Map<String, String> pairs = new HashMap<String, String>();
@@ -120,11 +120,11 @@ private void testIpV6(Reader reader, String fileName)
120120

121121
assertEquals("found expected data record for " + address + " in "
122122
+ fileName, data,
123-
reader.dataForAddress(InetAddress.getByName(address)));
123+
reader.get(InetAddress.getByName(address)));
124124
}
125125

126126
for (String ip : new String[] { "1.1.1.33", "255.254.253.123", "89fa::" }) {
127-
assertNull(reader.dataForAddress(InetAddress.getByName(ip)));
127+
assertNull(reader.get(InetAddress.getByName(ip)));
128128
}
129129

130130
}

0 commit comments

Comments
 (0)