Skip to content

Commit

Permalink
resolve format complaints in mDNS changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ka2ddo committed Jan 7, 2021
1 parent cc916e5 commit e838df6
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/main/java/org/xbill/DNS/SimpleResolver.java
Expand Up @@ -354,7 +354,7 @@ CompletableFuture<Message> sendAsync(Message query, boolean forceTcp) {

Verify1Response verify1Response = new Verify1Response(query, qid);
if (v instanceof byte[]) {
byte[] in = (byte[])v;
byte[] in = (byte[]) v;
Message response = verify1Response.parse(in);
if (response == null) {
f.completeExceptionally(verify1Response.getExc());
Expand All @@ -372,7 +372,7 @@ CompletableFuture<Message> sendAsync(Message query, boolean forceTcp) {
f.complete(response);
} else if (v instanceof ArrayList) {
@SuppressWarnings("unchecked")
ArrayList<byte[]> list = (ArrayList<byte[]>)v;
ArrayList<byte[]> list = (ArrayList<byte[]>) v;
Message response = null;
Throwable exc = null;
for (byte[] in : list) {
Expand Down Expand Up @@ -489,31 +489,31 @@ public Message parse(byte[] in) {
// validate name, class and type (rfc5452#section-9.1)
if (!query.getQuestion().getName().equals(r.getQuestion().getName())) {
exc =
new WireParseException(
"invalid name in message: expected "
+ query.getQuestion().getName()
+ "; got "
+ r.getQuestion().getName());
new WireParseException(
"invalid name in message: expected "
+ query.getQuestion().getName()
+ "; got "
+ r.getQuestion().getName());
return null;
}

if (query.getQuestion().getDClass() != r.getQuestion().getDClass()) {
exc =
new WireParseException(
"invalid class in message: expected "
+ DClass.string(query.getQuestion().getDClass())
+ "; got "
+ DClass.string(r.getQuestion().getDClass()));
new WireParseException(
"invalid class in message: expected "
+ DClass.string(query.getQuestion().getDClass())
+ "; got "
+ DClass.string(r.getQuestion().getDClass()));
return null;
}

if (query.getQuestion().getType() != r.getQuestion().getType()) {
exc =
new WireParseException(
"invalid type in message: expected "
+ Type.string(query.getQuestion().getType())
+ "; got "
+ Type.string(r.getQuestion().getType()));
new WireParseException(
"invalid type in message: expected "
+ Type.string(query.getQuestion().getType())
+ "; got "
+ Type.string(r.getQuestion().getType()));
return null;
}

Expand Down

0 comments on commit e838df6

Please sign in to comment.