Skip to content

Commit

Permalink
GH-2357: Fix Sonar Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Jul 20, 2022
1 parent 128372f commit 295b68c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ default ConsumerRecords<K, V> receive(Collection<TopicPartitionOffset> requested
default KafkaOperations2<K, V> usingCompletableFuture() {
return new KafkaOperations2<K, V>() {

KafkaOperations<K, V> ops;

@Override
public CompletableFuture<SendResult<K, V>> sendDefault(V data) {
return KafkaOperations.this.sendDefault(data).completable();
Expand Down Expand Up @@ -499,7 +497,7 @@ public ConsumerRecords<K, V> receive(Collection<TopicPartitionOffset> requested,

};

}
} // NOSONAR method line count

/**
* A callback for executing arbitrary operations on the {@link Producer}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@
*/
public class RequestReplyTypedMessageFuture<K, V, P> extends RequestReplyMessageFuture<K, V> {

private static final String UNCHECKED = "unchecked";

private Completable completable;

RequestReplyTypedMessageFuture(ListenableFuture<SendResult<K, V>> sendFuture) {
super(sendFuture);
}

@SuppressWarnings("unchecked")
@SuppressWarnings(UNCHECKED)
@Override
public Message<P> get() throws InterruptedException, ExecutionException {
return (Message<P>) super.get();
}

@SuppressWarnings("unchecked")
@SuppressWarnings(UNCHECKED)
@Override
public Message<P> get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
Expand All @@ -74,17 +76,17 @@ public synchronized Completable asCompletable() {
*/
public class Completable extends RequestReplyMessageFuture.Completable {

Completable(RequestReplyMessageFuture requestReplyMessageFuture, Future delegate) {
Completable(RequestReplyMessageFuture requestReplyMessageFuture, Future<Message<?>> delegate) { // NOSONAR
requestReplyMessageFuture.super(delegate);
}

@SuppressWarnings("unchecked")
@SuppressWarnings(UNCHECKED)
@Override
public Message<P> get() throws InterruptedException, ExecutionException {
return (Message<P>) super.get();
}

@SuppressWarnings("unchecked")
@SuppressWarnings(UNCHECKED)
@Override
public Message<P> get(long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException {
Expand Down

0 comments on commit 295b68c

Please sign in to comment.