Skip to content

Commit 37028fd

Browse files
committed
Remove unnecessary string concats after applying Java formatting
1 parent dc897e6 commit 37028fd

18 files changed

Lines changed: 57 additions & 59 deletions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private Element(int family, boolean negative, Object address, int prefixLength)
3535
this.address = address;
3636
this.prefixLength = prefixLength;
3737
if (!validatePrefixLength(family, prefixLength)) {
38-
throw new IllegalArgumentException("invalid prefix " + "length");
38+
throw new IllegalArgumentException("invalid prefix length");
3939
}
4040
}
4141

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private static int checkMaskLength(String field, int family, int val) {
4242
int max = Address.addressLength(family) * 8;
4343
if (val < 0 || val > max) {
4444
throw new IllegalArgumentException(
45-
"\"" + field + "\" " + val + " must be in the range " + "[0.." + max + "]");
45+
"\"" + field + "\" " + val + " must be in the range [0.." + max + "]");
4646
}
4747
return val;
4848
}
@@ -67,7 +67,7 @@ public ClientSubnetOption(int sourceNetmask, int scopeNetmask, InetAddress addre
6767
this.address = Address.truncate(address, sourceNetmask);
6868

6969
if (!address.equals(this.address)) {
70-
throw new IllegalArgumentException("source netmask is not " + "valid for address");
70+
throw new IllegalArgumentException("source netmask is not valid for address");
7171
}
7272
}
7373

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private void require(int n) throws WireParseException {
6262
*/
6363
public void setActive(int len) {
6464
if (len > byteBuffer.capacity() - byteBuffer.position()) {
65-
throw new IllegalArgumentException("cannot set active " + "region past end of input");
65+
throw new IllegalArgumentException("cannot set active region past end of input");
6666
}
6767
byteBuffer.limit(byteBuffer.position() + len);
6868
}
@@ -89,7 +89,7 @@ public int saveActive() {
8989
*/
9090
public void restoreActive(int pos) {
9191
if (pos > byteBuffer.capacity()) {
92-
throw new IllegalArgumentException("cannot set active " + "region past end of input");
92+
throw new IllegalArgumentException("cannot set active region past end of input");
9393
}
9494
byteBuffer.limit(byteBuffer.position());
9595
}
@@ -103,7 +103,7 @@ public void restoreActive(int pos) {
103103
*/
104104
public void jump(int index) {
105105
if (index >= byteBuffer.capacity()) {
106-
throw new IllegalArgumentException("cannot jump past " + "end of input");
106+
throw new IllegalArgumentException("cannot jump past end of input");
107107
}
108108
byteBuffer.position(index);
109109
byteBuffer.limit(byteBuffer.capacity());

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private void need(int n) {
6363
*/
6464
public void jump(int index) {
6565
if (index > pos) {
66-
throw new IllegalArgumentException("cannot jump past " + "end of data");
66+
throw new IllegalArgumentException("cannot jump past end of data");
6767
}
6868
pos = index;
6969
}
@@ -118,7 +118,7 @@ public void writeU16(int val) {
118118
public void writeU16At(int val, int where) {
119119
check(val, 16);
120120
if (where > pos - 2) {
121-
throw new IllegalArgumentException("cannot write past " + "end of data");
121+
throw new IllegalArgumentException("cannot write past end of data");
122122
}
123123
array[where++] = (byte) ((val >>> 8) & 0xFF);
124124
array[where++] = (byte) (val & 0xFF);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ void setCount(int field, int value) {
211211

212212
void incCount(int field) {
213213
if (counts[field] == 0xFFFF) {
214-
throw new IllegalStateException("DNS section count cannot " + "be incremented");
214+
throw new IllegalStateException("DNS section count cannot be incremented");
215215
}
216216
counts[field]++;
217217
}
218218

219219
void decCount(int field) {
220220
if (counts[field] == 0) {
221-
throw new IllegalStateException("DNS section count cannot " + "be decremented");
221+
throw new IllegalStateException("DNS section count cannot be decremented");
222222
}
223223
counts[field]--;
224224
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,24 @@ public IPSECKEYRecord(
7575
break;
7676
case Gateway.IPv4:
7777
if (!(gateway instanceof InetAddress)) {
78-
throw new IllegalArgumentException("\"gateway\" " + "must be an IPv4 " + "address");
78+
throw new IllegalArgumentException("\"gateway\" must be an IPv4 address");
7979
}
8080
this.gateway = gateway;
8181
break;
8282
case Gateway.IPv6:
8383
if (!(gateway instanceof Inet6Address)) {
84-
throw new IllegalArgumentException("\"gateway\" " + "must be an IPv6 " + "address");
84+
throw new IllegalArgumentException("\"gateway\" must be an IPv6 address");
8585
}
8686
this.gateway = gateway;
8787
break;
8888
case Gateway.Name:
8989
if (!(gateway instanceof Name)) {
90-
throw new IllegalArgumentException("\"gateway\" " + "must be a DNS " + "name");
90+
throw new IllegalArgumentException("\"gateway\" must be a DNS name");
9191
}
9292
this.gateway = checkName("gateway", (Name) gateway);
9393
break;
9494
default:
95-
throw new IllegalArgumentException("\"gatewayType\" " + "must be between 0 and 3");
95+
throw new IllegalArgumentException("\"gatewayType\" must be between 0 and 3");
9696
}
9797

9898
this.key = key;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public NSEC3PARAMRecord(
5353

5454
if (salt != null) {
5555
if (salt.length > 255) {
56-
throw new IllegalArgumentException("Invalid salt " + "length");
56+
throw new IllegalArgumentException("Invalid salt length");
5757
}
5858
if (salt.length > 0) {
5959
this.salt = new byte[salt.length];

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public Name(byte[] b) throws IOException {
410410
public Name(Name src, int n) {
411411
int slabels = src.labels();
412412
if (n > slabels) {
413-
throw new IllegalArgumentException("attempted to remove too " + "many labels");
413+
throw new IllegalArgumentException("attempted to remove too many labels");
414414
}
415415
name = src.name;
416416
setlabels(slabels - n);
@@ -465,7 +465,7 @@ public Name relativize(Name origin) {
465465
*/
466466
public Name wild(int n) {
467467
if (n < 1) {
468-
throw new IllegalArgumentException("must replace 1 or more " + "labels");
468+
throw new IllegalArgumentException("must replace 1 or more labels");
469469
}
470470
try {
471471
Name newname = new Name();
@@ -679,7 +679,7 @@ public String getLabelString(int n) {
679679
*/
680680
public void toWire(DNSOutput out, Compression c) {
681681
if (!isAbsolute()) {
682-
throw new IllegalArgumentException("toWire() called on " + "non-absolute name");
682+
throw new IllegalArgumentException("toWire() called on non-absolute name");
683683
}
684684

685685
int labels = labels();

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ public static Record fromString(
436436
data = new byte[0];
437437
}
438438
if (length != data.length) {
439-
throw st.exception("invalid unknown RR encoding: " + "length mismatch");
439+
throw st.exception("invalid unknown RR encoding: length mismatch");
440440
}
441441
DNSInput in = new DNSInput(data);
442442
return newRecord(name, type, dclass, ttl, length, in);
@@ -643,7 +643,7 @@ public Name getAdditionalName() {
643643
static int checkU8(String field, int val) {
644644
if (val < 0 || val > 0xFF) {
645645
throw new IllegalArgumentException(
646-
"\"" + field + "\" " + val + " must be an unsigned 8 " + "bit value");
646+
"\"" + field + "\" " + val + " must be an unsigned 8 bit value");
647647
}
648648
return val;
649649
}
@@ -652,7 +652,7 @@ static int checkU8(String field, int val) {
652652
static int checkU16(String field, int val) {
653653
if (val < 0 || val > 0xFFFF) {
654654
throw new IllegalArgumentException(
655-
"\"" + field + "\" " + val + " must be an unsigned 16 " + "bit value");
655+
"\"" + field + "\" " + val + " must be an unsigned 16 bit value");
656656
}
657657
return val;
658658
}
@@ -661,7 +661,7 @@ static int checkU16(String field, int val) {
661661
static long checkU32(String field, long val) {
662662
if (val < 0 || val > 0xFFFFFFFFL) {
663663
throw new IllegalArgumentException(
664-
"\"" + field + "\" " + val + " must be an unsigned 32 " + "bit value");
664+
"\"" + field + "\" " + val + " must be an unsigned 32 bit value");
665665
}
666666
return val;
667667
}
@@ -678,7 +678,7 @@ static Name checkName(String field, Name name) {
678678
static byte[] checkByteArrayLength(String field, byte[] array, int maxLength) {
679679
if (array.length > 0xFFFF) {
680680
throw new IllegalArgumentException(
681-
"\"" + field + "\" array " + "must have no more than " + maxLength + " elements");
681+
"\"" + field + "\" array must have no more than " + maxLength + " elements");
682682
}
683683
byte[] out = new byte[array.length];
684684
System.arraycopy(array, 0, out, 0, array.length);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private ReverseMap() {}
2929
*/
3030
public static Name fromAddress(byte[] addr) {
3131
if (addr.length != 4 && addr.length != 16) {
32-
throw new IllegalArgumentException("array must contain " + "4 or 16 elements");
32+
throw new IllegalArgumentException("array must contain 4 or 16 elements");
3333
}
3434

3535
StringBuilder sb = new StringBuilder();
@@ -76,7 +76,7 @@ public static Name fromAddress(int[] addr) {
7676
byte[] bytes = new byte[addr.length];
7777
for (int i = 0; i < addr.length; i++) {
7878
if (addr[i] < 0 || addr[i] > 0xFF) {
79-
throw new IllegalArgumentException("array must " + "contain values " + "between 0 and 255");
79+
throw new IllegalArgumentException("array must contain values between 0 and 255");
8080
}
8181
bytes[i] = (byte) addr[i];
8282
}

0 commit comments

Comments
 (0)