Skip to content

Commit 0cc4dfb

Browse files
author
Matthew L Daniel
committed
Remove unnecessary throws declarations
Those warnings in IJ hide potentially real bugs.
1 parent 63cb718 commit 0cc4dfb

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.net.InetAddress;
1414
import java.net.URI;
1515
import java.net.URISyntaxException;
16-
import java.net.UnknownHostException;
1716
import java.util.HashMap;
1817
import java.util.Map;
1918

@@ -29,7 +28,7 @@ public class ReaderTest {
2928
private final ObjectMapper om = new ObjectMapper();
3029

3130
@Test
32-
public void test() throws InvalidDatabaseException, IOException,
31+
public void test() throws IOException,
3332
URISyntaxException {
3433
for (long recordSize : new long[] { 24, 28, 32 }) {
3534
for (int ipVersion : new int[] { 4, 6 }) {
@@ -244,8 +243,7 @@ private void testBrokenSearchTreePointer(Reader reader) throws URISyntaxExceptio
244243
}
245244

246245
@Test
247-
public void testBrokenDataPointerFile() throws UnknownHostException,
248-
IOException, URISyntaxException {
246+
public void testBrokenDataPointerFile() throws IOException, URISyntaxException {
249247
URI file = ReaderTest.class
250248
.getResource(
251249
"/maxmind-db/test-data/MaxMind-DB-test-broken-pointers-24.mmdb")
@@ -255,8 +253,7 @@ public void testBrokenDataPointerFile() throws UnknownHostException,
255253
testBrokenDataPointer(reader);
256254
}
257255
@Test
258-
public void testBrokenDataPointerURL() throws UnknownHostException,
259-
IOException, URISyntaxException {
256+
public void testBrokenDataPointerURL() throws IOException, URISyntaxException {
260257
InputStream stream = ReaderTest.class
261258
.getResource(
262259
"/maxmind-db/test-data/MaxMind-DB-test-broken-pointers-24.mmdb")
@@ -265,8 +262,7 @@ public void testBrokenDataPointerURL() throws UnknownHostException,
265262
Reader reader = new Reader(stream);
266263
testBrokenDataPointer(reader);
267264
}
268-
private void testBrokenDataPointer(Reader reader) throws UnknownHostException,
269-
IOException, URISyntaxException {
265+
private void testBrokenDataPointer(Reader reader) throws IOException, URISyntaxException {
270266

271267
this.thrown.expect(InvalidDatabaseException.class);
272268
this.thrown
@@ -296,7 +292,7 @@ private void testMetadata(Reader reader, int ipVersion,
296292
}
297293

298294
private void testIpV4(Reader reader, URI file)
299-
throws InvalidDatabaseException, IOException {
295+
throws IOException {
300296

301297
for (int i = 0; i <= 5; i++) {
302298
String address = "1.1.1." + (int) Math.pow(2, i);
@@ -330,7 +326,7 @@ private void testIpV4(Reader reader, URI file)
330326

331327
// XXX - logic could be combined with above
332328
private void testIpV6(Reader reader, URI file)
333-
throws InvalidDatabaseException, IOException {
329+
throws IOException {
334330
String[] subnets = new String[] { "::1:ffff:ffff", "::2:0:0",
335331
"::2:0:40", "::2:0:50", "::2:0:58" };
336332

0 commit comments

Comments
 (0)