Skip to content

Commit

Permalink
Resolve several Sonar reported issues
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed Jan 22, 2021
1 parent 60618a2 commit eb39afc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,13 +20,13 @@
import java.util.Arrays;
import java.util.List;

import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.Topology;

/**
* Composite {@link KafkaStreamsInfrastructureCustomizer} customizes {@link KafkaStreams}
* by delegating to a list of provided {@link KafkaStreamsInfrastructureCustomizer}.
* Composite {@link KafkaStreamsInfrastructureCustomizer} customizes
* {@link org.apache.kafka.streams.KafkaStreams} by delegating to a list of provided
* {@link KafkaStreamsInfrastructureCustomizer}.
*
* @author Gary Russell
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor;
import org.springframework.lang.Nullable;
import org.springframework.messaging.handler.annotation.support.MessageHandlerMethodFactory;
import org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolver;
Expand Down Expand Up @@ -91,7 +90,8 @@ public List<HandlerMethodArgumentResolver> getCustomMethodArgumentResolvers() {
}

/**
* Add custom methods arguments resolvers to {@link KafkaListenerAnnotationBeanPostProcessor}
* Add custom methods arguments resolvers to
* {@link org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor}
* Default empty list.
* @param methodArgumentResolvers the methodArgumentResolvers to assign.
* @since 2.4.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.regex.Pattern;

import org.aopalliance.aop.Advice;
Expand All @@ -32,7 +31,6 @@
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.support.AopUtils;
import org.springframework.core.task.AsyncListenableTaskExecutor;
import org.springframework.kafka.support.KafkaHeaders;
import org.springframework.kafka.support.TopicPartitionOffset;
import org.springframework.lang.Nullable;
import org.springframework.scheduling.TaskScheduler;
Expand Down Expand Up @@ -369,7 +367,7 @@ public void setShutdownTimeout(long shutdownTimeout) {
* <ul>
* <li>this property</li>
* <li>{@code ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG} in
* {@link #setKafkaConsumerProperties(Properties)}</li>
* {@link #setKafkaConsumerProperties(java.util.Properties)}</li>
* <li>{@code ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG} in the consumer factory
* properties</li>
* <li>60 seconds</li>
Expand Down Expand Up @@ -640,9 +638,11 @@ public boolean isDeliveryAttemptHeader() {
}

/**
* Set to true to populate the {@link KafkaHeaders#DELIVERY_ATTEMPT} header when the
* error handler or after rollback processor implements {@code DeliveryAttemptAware}.
* There is a small overhead so this is false by default.
* Set to true to populate the
* {@link org.springframework.kafka.support.KafkaHeaders#DELIVERY_ATTEMPT} header when
* the error handler or after rollback processor implements
* {@code DeliveryAttemptAware}. There is a small overhead so this is false by
* default.
* @param deliveryAttemptHeader true to populate
* @since 2.5
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,8 @@ public boolean isLongLived() {
return true;
}

@Override
public void run() { // NOSONAR complexity
@Override // NOSONAR complexity
public void run() {
ListenerUtils.setLogOnlyMetadata(this.containerProperties.isOnlyLogRecordMetadata());
publishConsumerStartingEvent();
this.consumerThread = Thread.currentThread();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2017-2020 the original author or authors.
* Copyright 2017-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,7 +22,6 @@
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecord;

import org.springframework.kafka.listener.ContainerProperties.AckMode;
import org.springframework.lang.Nullable;
import org.springframework.util.backoff.BackOff;

Expand Down Expand Up @@ -85,9 +84,9 @@ public SeekToCurrentErrorHandler(@Nullable BiConsumer<ConsumerRecord<?, ?>, Exce

/**
* {@inheritDoc}
* The container
* must be configured with {@link AckMode#MANUAL_IMMEDIATE}. Whether or not
* the commit is sync or async depends on the container's syncCommits
* The container must be configured with
* {@link org.springframework.kafka.listener.ContainerProperties.AckMode#MANUAL_IMMEDIATE}.
* Whether or not the commit is sync or async depends on the container's syncCommits
* property.
* @param commitRecovered true to commit.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 the original author or authors.
* Copyright 2018-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,12 +18,9 @@

import org.springframework.kafka.core.ProducerFactory;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.support.ResourceTransactionManager;

/**
* A transaction manager that can provide a {@link ProducerFactory}.
* Currently a sub-interface of {@link ResourceTransactionManager}
* for backwards compatibility.
*
* @param <K> the key type.
* @param <V> the value type.
Expand Down

0 comments on commit eb39afc

Please sign in to comment.