Skip to content

Commit 82093f9

Browse files
committed
chore: Sonarqube improvements
1 parent 181ee09 commit 82093f9

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/main/java/com/endava/cats/fuzzer/fields/base/TwoXXorFourXXReplaceStringsFuzzer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protected TwoXXorFourXXReplaceStringsFuzzer(TestCaseListener testCaseListener, F
4040
this.fieldsIteratorExecutor = fieldsIteratorExecutor;
4141
}
4242

43+
@Override
4344
public void fuzz(FuzzingData data) {
4445
ResponseCodeFamily expectedResponseCodes = new ResponseCodeFamilyDynamic(List.of("2XX", "4XX"));
4546
fieldsIteratorExecutor.execute(

src/main/java/com/endava/cats/fuzzer/special/mutators/api/Mutator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public interface Mutator extends Comparable<Mutator> {
3636
*/
3737
String description();
3838

39+
@Override
3940
default int compareTo(Mutator o) {
4041
return this.getClass().getSimpleName().compareTo(o.getClass().getSimpleName());
4142
}

src/main/java/com/endava/cats/http/ResponseCodeFamilyDynamic.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ public List<String> allowedResponseCodes() {
2727

2828
@Override
2929
public boolean equals(Object o) {
30-
if (o == null || getClass() != o.getClass()) return false;
31-
ResponseCodeFamilyDynamic that = (ResponseCodeFamilyDynamic) o;
32-
return Objects.equals(responseCodes, that.responseCodes);
30+
if (o instanceof ResponseCodeFamilyDynamic that) {
31+
return Objects.equals(responseCodes, that.responseCodes);
32+
}
33+
return false;
3334
}
3435

3536
@Override

src/main/java/com/endava/cats/util/JsonUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public static boolean isValidJson(String text) {
293293
return false;
294294
}
295295
try {
296-
JSON_STRICT_PARSER.fromJson(text, Object.class);
296+
var unused = JSON_STRICT_PARSER.fromJson(text, Object.class);
297297
} catch (Exception e) {
298298
return false;
299299
}

0 commit comments

Comments
 (0)