Fix inspection issues

This commit is contained in:
AsamK 2023-12-15 17:32:30 +01:00
parent fc6a4b78eb
commit caa4fa0180
12 changed files with 12 additions and 15 deletions

View file

@ -2,8 +2,6 @@ package org.asamk.signal.jsonrpc;
/**
* Represents a JSON-RPC (batch) request or (batch) response.
* https://www.jsonrpc.org/specification
* <a href="https://www.jsonrpc.org/specification">https://www.jsonrpc.org/specification</a>
*/
public sealed abstract class JsonRpcMessage permits JsonRpcBatchMessage, JsonRpcRequest, JsonRpcResponse {
}
public sealed abstract class JsonRpcMessage permits JsonRpcBatchMessage, JsonRpcRequest, JsonRpcResponse {}

View file

@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ValueNode;
/**
* Represents a JSON-RPC request.
* https://www.jsonrpc.org/specification#request_object
* <a href="https://www.jsonrpc.org/specification#request_object">https://www.jsonrpc.org/specification#request_object</a>
*/
public final class JsonRpcRequest extends JsonRpcMessage {

View file

@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ValueNode;
/**
* Represents a JSON-RPC response.
* https://www.jsonrpc.org/specification#response_object
* <a href="https://www.jsonrpc.org/specification#response_object">https://www.jsonrpc.org/specification#response_object</a>
*/
public final class JsonRpcResponse extends JsonRpcMessage {

View file

@ -94,7 +94,7 @@ public class SignalJsonRpcCommandHandler {
if (manager == null) {
final var managers = c.getManagers();
if (managers.size() == 1) {
manager = managers.get(0);
manager = managers.getFirst();
}
}
if (manager != null) {

View file

@ -126,7 +126,7 @@ public class SignalJsonRpcDispatcherHandler {
private void unsubscribeReceive(final Manager m) {
final var subscriptionId = receiveHandlers.entrySet()
.stream()
.filter(e -> e.getValue().size() == 1 && e.getValue().get(0).first().equals(m))
.filter(e -> e.getValue().size() == 1 && e.getValue().getFirst().first().equals(m))
.map(Map.Entry::getKey)
.findFirst();
subscriptionId.ifPresent(this::unsubscribeReceive);