Skip to content

Commit

Permalink
Fix stuff Sonar considers as a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ibauersachs committed Nov 5, 2023
1 parent cd23ca6 commit c2b28b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/xbill/DNS/dnssec/ByteArrayComparator.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ final class ByteArrayComparator {
private static final int MAX_BYTE = 0xFF;

/** {@inheritDoc} */
public int compare(Object o1, Object o2) {
byte[] b1 = (byte[]) o1;
byte[] b2 = (byte[]) o2;

public int compare(byte[] b1, byte[] b2) {
if (b1.length != b2.length) {
return b1.length - b2.length;
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/xbill/DNS/NameTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,14 @@ void ctor_max_length_rel_with_abs_origin() throws TextParseException {
}

@Test
void ctor_too_long_rel_with_rel_origin() throws TextParseException {
void ctor_too_long_rel_with_rel_origin() {
// relative name with three 63-char labels and a 53-char label with an 8-char relative origin
assertThrows(
TextParseException.class,
() ->
new Name(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddddddddddddddddddddddddddddd",
new Name("relative")));
Name.fromConstantString("relative")));
}

@Test
Expand All @@ -396,7 +396,7 @@ void ctor_too_long_rel_with_abs_origin() {
() ->
new Name(
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddddddddddddddddddddddddddddd",
new Name("absolute.")));
Name.fromConstantString("absolute.")));
}

@Test
Expand Down

0 comments on commit c2b28b8

Please sign in to comment.