Skip to content

Commit b7f3929

Browse files
committed
Remove unnecessary exception declarations
1 parent 4276ad7 commit b7f3929

File tree

13 files changed

+38
-43
lines changed

13 files changed

+38
-43
lines changed

src/main/java/org/xbill/DNS/ZoneTransferIn.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.io.IOException;
2525
import java.net.InetSocketAddress;
2626
import java.net.SocketAddress;
27-
import java.net.UnknownHostException;
2827
import java.util.ArrayList;
2928
import java.util.List;
3029
import lombok.extern.slf4j.Slf4j;
@@ -94,31 +93,31 @@ private Delta() {
9493
public interface ZoneTransferHandler {
9594

9695
/** Called when an AXFR transfer begins. */
97-
void startAXFR() throws ZoneTransferException;
96+
void startAXFR();
9897

9998
/** Called when an IXFR transfer begins. */
100-
void startIXFR() throws ZoneTransferException;
99+
void startIXFR();
101100

102101
/**
103102
* Called when a series of IXFR deletions begins.
104103
*
105104
* @param soa The starting SOA.
106105
*/
107-
void startIXFRDeletes(Record soa) throws ZoneTransferException;
106+
void startIXFRDeletes(Record soa);
108107

109108
/**
110109
* Called when a series of IXFR adds begins.
111110
*
112111
* @param soa The starting SOA.
113112
*/
114-
void startIXFRAdds(Record soa) throws ZoneTransferException;
113+
void startIXFRAdds(Record soa);
115114

116115
/**
117116
* Called for each content record in an AXFR.
118117
*
119118
* @param r The DNS record.
120119
*/
121-
void handleRecord(Record r) throws ZoneTransferException;
120+
void handleRecord(Record r);
122121
}
123122

124123
private static class BasicHandler implements ZoneTransferHandler {
@@ -270,10 +269,9 @@ public static ZoneTransferIn newIXFR(
270269
* @param host The host from which to transfer the zone.
271270
* @param key The TSIG key used to authenticate the transfer, or null.
272271
* @return The ZoneTransferIn object.
273-
* @throws UnknownHostException The host does not exist.
274272
*/
275273
public static ZoneTransferIn newIXFR(
276-
Name zone, long serial, boolean fallback, String host, TSIG key) throws UnknownHostException {
274+
Name zone, long serial, boolean fallback, String host, TSIG key) {
277275
return newIXFR(zone, serial, fallback, host, 0, key);
278276
}
279277

src/main/java/org/xbill/DNS/tools/update.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ static void help(String topic) {
678678
}
679679
}
680680

681-
public static void main(String[] args) throws IOException {
681+
public static void main(String[] args) {
682682

683683
InputStream in = null;
684684
if (args.length >= 1) {

src/test/java/org/xbill/DNS/APLRecordTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void validIPv4_short_address() throws IOException {
217217
}
218218

219219
@Test
220-
void invalid_IPv4_prefix() throws IOException {
220+
void invalid_IPv4_prefix() {
221221
byte[] raw =
222222
new byte[] {
223223
0,
@@ -236,7 +236,7 @@ void invalid_IPv4_prefix() throws IOException {
236236
}
237237

238238
@Test
239-
void invalid_IPv4_length() throws IOException {
239+
void invalid_IPv4_length() {
240240
byte[] raw =
241241
new byte[] {
242242
0,
@@ -404,77 +404,77 @@ void validIPv6() throws IOException {
404404
}
405405

406406
@Test
407-
void no_colon() throws IOException {
407+
void no_colon() {
408408
Tokenizer t = new Tokenizer("!1192.68.0.1/20");
409409
APLRecord ar = new APLRecord();
410410
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
411411
}
412412

413413
@Test
414-
void colon_and_slash_swapped() throws IOException {
414+
void colon_and_slash_swapped() {
415415
Tokenizer t = new Tokenizer("!1/192.68.0.1:20");
416416
APLRecord ar = new APLRecord();
417417
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
418418
}
419419

420420
@Test
421-
void no_slash() throws IOException {
421+
void no_slash() {
422422
Tokenizer t = new Tokenizer("!1:192.68.0.1|20");
423423
APLRecord ar = new APLRecord();
424424
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
425425
}
426426

427427
@Test
428-
void empty_family() throws IOException {
428+
void empty_family() {
429429
Tokenizer t = new Tokenizer("!:192.68.0.1/20");
430430
APLRecord ar = new APLRecord();
431431
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
432432
}
433433

434434
@Test
435-
void malformed_family() throws IOException {
435+
void malformed_family() {
436436
Tokenizer t = new Tokenizer("family:192.68.0.1/20");
437437
APLRecord ar = new APLRecord();
438438
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
439439
}
440440

441441
@Test
442-
void invalid_family() throws IOException {
442+
void invalid_family() {
443443
Tokenizer t = new Tokenizer("3:192.68.0.1/20");
444444
APLRecord ar = new APLRecord();
445445
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
446446
}
447447

448448
@Test
449-
void empty_prefix() throws IOException {
449+
void empty_prefix() {
450450
Tokenizer t = new Tokenizer("1:192.68.0.1/");
451451
APLRecord ar = new APLRecord();
452452
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
453453
}
454454

455455
@Test
456-
void malformed_prefix() throws IOException {
456+
void malformed_prefix() {
457457
Tokenizer t = new Tokenizer("1:192.68.0.1/prefix");
458458
APLRecord ar = new APLRecord();
459459
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
460460
}
461461

462462
@Test
463-
void invalid_prefix() throws IOException {
463+
void invalid_prefix() {
464464
Tokenizer t = new Tokenizer("1:192.68.0.1/33");
465465
APLRecord ar = new APLRecord();
466466
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
467467
}
468468

469469
@Test
470-
void empty_address() throws IOException {
470+
void empty_address() {
471471
Tokenizer t = new Tokenizer("1:/33");
472472
APLRecord ar = new APLRecord();
473473
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));
474474
}
475475

476476
@Test
477-
void malformed_address() throws IOException {
477+
void malformed_address() {
478478
Tokenizer t = new Tokenizer("1:A.B.C.D/33");
479479
APLRecord ar = new APLRecord();
480480
assertThrows(TextParseException.class, () -> ar.rdataFromString(t, null));

src/test/java/org/xbill/DNS/EmptyRecordTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void getObject() {
5959
}
6060

6161
@Test
62-
void rrFromWire() throws IOException {
62+
void rrFromWire() {
6363
DNSInput i = new DNSInput(new byte[] {1, 2, 3, 4, 5});
6464
i.jump(3);
6565

src/test/java/org/xbill/DNS/FormattedTimeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void format() {
5454
}
5555

5656
@Test
57-
void parse() throws DateTimeParseException, TextParseException {
57+
void parse() throws DateTimeParseException {
5858
// have to make sure to clear out the milliseconds since there
5959
// is occasionally a difference between when cal and cal2 are
6060
// instantiated.

src/test/java/org/xbill/DNS/GPOSRecordTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ void basic() throws IOException {
237237
}
238238

239239
@Test
240-
void longitude_toosmall() throws IOException {
240+
void longitude_toosmall() {
241241
byte[] raw =
242242
new byte[] {
243243
5, '-', '9', '5', '.', '0', 6, '1', '2', '3', '.', '0', '7', 3, '0', '.', '0'
@@ -249,7 +249,7 @@ void longitude_toosmall() throws IOException {
249249
}
250250

251251
@Test
252-
void longitude_toobig() throws IOException {
252+
void longitude_toobig() {
253253
byte[] raw =
254254
new byte[] {
255255
5, '1', '8', '5', '.', '0', 6, '1', '2', '3', '.', '0', '7', 3, '0', '.', '0'
@@ -261,7 +261,7 @@ void longitude_toobig() throws IOException {
261261
}
262262

263263
@Test
264-
void latitude_toosmall() throws IOException {
264+
void latitude_toosmall() {
265265
byte[] raw =
266266
new byte[] {
267267
5, '-', '8', '5', '.', '0', 6, '-', '1', '9', '0', '.', '0', 3, '0', '.', '0'
@@ -273,7 +273,7 @@ void latitude_toosmall() throws IOException {
273273
}
274274

275275
@Test
276-
void latitude_toobig() throws IOException {
276+
void latitude_toobig() {
277277
byte[] raw =
278278
new byte[] {
279279
5, '-', '8', '5', '.', '0', 6, '2', '1', '9', '0', '.', '0', 3, '0', '.', '0'

src/test/java/org/xbill/DNS/HINFORecordTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void rdataFromString() throws IOException {
131131
}
132132

133133
@Test
134-
void rdataFromString_invalid_CPU() throws IOException {
134+
void rdataFromString_invalid_CPU() {
135135
String cpu = "Intel(R) Pentium(R) \\388 M processor 1.70GHz";
136136
String os = "Linux troy 2.6.10-gentoo-r6";
137137

@@ -142,7 +142,7 @@ void rdataFromString_invalid_CPU() throws IOException {
142142
}
143143

144144
@Test
145-
void rdataFromString_invalid_OS() throws IOException {
145+
void rdataFromString_invalid_OS() {
146146
String cpu = "Intel(R) Pentium(R) M processor 1.70GHz";
147147

148148
Tokenizer t = new Tokenizer("\"" + cpu + "\"");

src/test/java/org/xbill/DNS/NULLRecordTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
import static org.junit.jupiter.api.Assertions.assertThrows;
44
import static org.junit.jupiter.api.Assertions.assertTrue;
55

6-
import java.io.IOException;
76
import org.junit.jupiter.api.Test;
87

98
class NULLRecordTest {
109

1110
@Test
12-
void rdataFromString() throws IOException {
11+
void rdataFromString() {
1312
TextParseException thrown =
1413
assertThrows(
1514
TextParseException.class,

src/test/java/org/xbill/DNS/NameTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ void basic() throws IOException {
516516
}
517517

518518
@Test
519-
void incomplete() throws IOException {
519+
void incomplete() {
520520
assertThrows(WireParseException.class, () -> new Name(new byte[] {3, 'W', 'w', 'w'}));
521521
}
522522

@@ -528,7 +528,7 @@ void root() throws WireParseException {
528528
}
529529

530530
@Test
531-
void invalid_length() throws IOException {
531+
void invalid_length() {
532532
assertThrows(WireParseException.class, () -> new Name(new byte[] {4, 'W', 'w', 'w'}));
533533
}
534534

src/test/java/org/xbill/DNS/OPTRecordTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import static org.junit.jupiter.api.Assertions.assertThrows;
66
import static org.junit.jupiter.api.Assertions.assertTrue;
77

8-
import java.io.IOException;
98
import org.junit.jupiter.api.Test;
109

1110
class OPTRecordTest {
@@ -39,7 +38,7 @@ void testForEquality() {
3938
}
4039

4140
@Test
42-
void rdataFromString() throws IOException {
41+
void rdataFromString() {
4342
TextParseException thrown =
4443
assertThrows(
4544
TextParseException.class,

0 commit comments

Comments
 (0)