Skip to content

Commit ec3a5a8

Browse files
committed
fix(Sonar): clean some Sonar issues
1 parent 1c62a70 commit ec3a5a8

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

api/src/main/java/io/kafbat/ui/service/audit/AuditRecord.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ static OperationResult successful() {
5353
}
5454

5555
static OperationResult error(Throwable th) {
56-
OperationError err = OperationError.UNRECOGNIZED_ERROR;
57-
switch (th) {
58-
case AccessDeniedException ignored -> err = OperationError.ACCESS_DENIED;
59-
case ValidationException ignored -> err = OperationError.VALIDATION_ERROR;
60-
case CustomBaseException ignored -> err = OperationError.EXECUTION_ERROR;
61-
case null, default -> {
62-
}
63-
}
56+
OperationError err = switch (th) {
57+
case AccessDeniedException ignored -> OperationError.ACCESS_DENIED;
58+
case ValidationException ignored -> OperationError.VALIDATION_ERROR;
59+
case CustomBaseException ignored -> OperationError.EXECUTION_ERROR;
60+
case null, default -> OperationError.UNRECOGNIZED_ERROR;
61+
};
6462
return new OperationResult(false, err);
6563
}
6664

api/src/main/java/io/kafbat/ui/util/jsonschema/AvroJsonSchemaConverter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ private JsonType convertType(Schema schema) {
157157
case ARRAY -> new SimpleJsonType(JsonType.Type.ARRAY);
158158
case FIXED, FLOAT, DOUBLE -> new SimpleJsonType(JsonType.Type.NUMBER);
159159
case BOOLEAN -> new SimpleJsonType(JsonType.Type.BOOLEAN);
160-
//case BYTES, STRING -> new SimpleJsonType(JsonType.Type.STRING);
161-
default -> new SimpleJsonType(JsonType.Type.STRING);
160+
default -> new SimpleJsonType(JsonType.Type.STRING); // BYTES, STRING and the remaining possibilities
162161
};
163162
}
164163
}

0 commit comments

Comments
 (0)