Skip to content

Commit

Permalink
Remove unused annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
vikinatora committed Apr 4, 2023
1 parent a195f1f commit 6d2ea9a
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ public LightMessagesProtocol(LightMessagesEngine engine) {
this.engine = engine;
}

@NotNull
@Override
protected CompletableFuture<LightMessagesController> onStartInitiator(@NotNull Stream stream) {
protected CompletableFuture<LightMessagesController> onStartInitiator( Stream stream) {
stream.pushHandler(new ProtobufVarint32FrameDecoder());
stream.pushHandler(new ProtobufDecoder(LightClientMessage.Response.getDefaultInstance()));

Expand All @@ -39,9 +38,8 @@ protected CompletableFuture<LightMessagesController> onStartInitiator(@NotNull S
return CompletableFuture.completedFuture(handler);
}

@NotNull
@Override
protected CompletableFuture<LightMessagesController> onStartResponder(@NotNull Stream stream) {
protected CompletableFuture<LightMessagesController> onStartResponder(Stream stream) {
stream.pushHandler(new ProtobufVarint32FrameDecoder());
stream.pushHandler(new ProtobufDecoder(LightClientMessage.Request.getDefaultInstance()));

Expand All @@ -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<LightClientMessage.Response> send(LightClientMessage.Request msg) {
throw new IllegalStateException("Responder only!");
throw new IllegalStateException("Host can't process inbound requests yet!");
}

}
Expand All @@ -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();
}
Expand All @@ -97,12 +95,12 @@ public CompletableFuture<LightClientMessage.Response> 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);
}

Expand Down

0 comments on commit 6d2ea9a

Please sign in to comment.