Skip to content

Commit a606f1b

Browse files
committed
Pattern matching improvements
1 parent e4fc542 commit a606f1b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

server/src/main/java/dev/findfirst/core/service/RobotsFetcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public record RobotsTxtResponse(int statusCode, byte[] text, String contentType)
4141

4242
@Override
4343
public final boolean equals(Object obj) {
44-
if (obj != null && obj instanceof RobotsTxtResponse robotTxt) {
45-
return robotTxt.statusCode() == this.statusCode() && robotTxt.text() == this.text()
46-
&& robotTxt.contentType.equals(this.contentType());
44+
if (obj != null && obj instanceof RobotsTxtResponse(int statusCode, byte[] text, String ct)) {
45+
return statusCode == this.statusCode() && Arrays.equals(this.text(), text)
46+
&& this.contentType.equals(ct);
4747
} else {
4848
return false;
4949
}

0 commit comments

Comments
 (0)