Use .isEmpty() for checking lists and strings

This commit is contained in:
AsamK 2023-10-17 20:01:59 +02:00
parent 9ba70c1808
commit d51dd7ae57
17 changed files with 70 additions and 70 deletions

View file

@ -127,7 +127,7 @@ public class JsonRpcReader {
Util.closeExecutorService(executor);
}
if (responseList.size() > 0) {
if (!responseList.isEmpty()) {
jsonRpcSender.sendBatchResponses(responseList);
}
}
@ -193,7 +193,7 @@ public class JsonRpcReader {
null), null));
return null;
} else if (jsonNode.isArray()) {
if (jsonNode.size() == 0) {
if (jsonNode.isEmpty()) {
jsonRpcSender.sendResponse(JsonRpcResponse.forError(new JsonRpcResponse.Error(JsonRpcResponse.Error.INVALID_REQUEST,
"invalid request",
null), null));