From 6d2ea9a2893fdf686d44896988c975c41772c1bf Mon Sep 17 00:00:00 2001 From: vikinatora Date: Tue, 4 Apr 2023 15:05:19 +0300 Subject: [PATCH] Remove unused annotations --- .../lightclient/LightMessagesProtocol.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/limechain/network/substream/lightclient/LightMessagesProtocol.java b/src/main/java/com/limechain/network/substream/lightclient/LightMessagesProtocol.java index 5254543bf..3fd776a8f 100644 --- a/src/main/java/com/limechain/network/substream/lightclient/LightMessagesProtocol.java +++ b/src/main/java/com/limechain/network/substream/lightclient/LightMessagesProtocol.java @@ -25,9 +25,8 @@ public LightMessagesProtocol(LightMessagesEngine engine) { this.engine = engine; } - @NotNull @Override - protected CompletableFuture onStartInitiator(@NotNull Stream stream) { + protected CompletableFuture onStartInitiator( Stream stream) { stream.pushHandler(new ProtobufVarint32FrameDecoder()); stream.pushHandler(new ProtobufDecoder(LightClientMessage.Response.getDefaultInstance())); @@ -39,9 +38,8 @@ protected CompletableFuture onStartInitiator(@NotNull S return CompletableFuture.completedFuture(handler); } - @NotNull @Override - protected CompletableFuture onStartResponder(@NotNull Stream stream) { + protected CompletableFuture onStartResponder(Stream stream) { stream.pushHandler(new ProtobufVarint32FrameDecoder()); stream.pushHandler(new ProtobufDecoder(LightClientMessage.Request.getDefaultInstance())); @@ -62,13 +60,13 @@ public Receiver(LightMessagesEngine engine) { } @Override - public void onMessage(@NotNull Stream stream, LightClientMessage.Request msg) { + public void onMessage(Stream stream, LightClientMessage.Request msg) { engine.receiveRequest(msg, stream); } @Override public CompletableFuture send(LightClientMessage.Request msg) { - throw new IllegalStateException("Responder only!"); + throw new IllegalStateException("Host can't process inbound requests yet!"); } } @@ -85,7 +83,7 @@ public Sender(Stream stream) { } @Override - public void onMessage(@NotNull Stream stream, LightClientMessage.Response msg) { + public void onMessage(Stream stream, LightClientMessage.Response msg) { resp.complete(msg); stream.closeWrite(); } @@ -97,12 +95,12 @@ public CompletableFuture send(LightClientMessage.Re } @Override - public void onClosed(@NotNull Stream stream) { + public void onClosed(Stream stream) { resp.completeExceptionally(new ConnectionClosedException()); } @Override - public void onException(@Nullable Throwable cause) { + public void onException(Throwable cause) { resp.completeExceptionally(cause); }