Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary Autowired from Constructors #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.apache.kafka.clients.producer.ProducerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -52,7 +51,6 @@ public class KafkaProducerManager {
}
};

@Autowired
public KafkaProducerManager(
@Value("${conductor.tasks.kafka-publish.requestTimeout:100ms}") Duration requestTimeout,
@Value("${conductor.tasks.kafka-publish.maxBlock:500ms}") Duration maxBlock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.kafka.common.serialization.StringSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.netflix.conductor.core.execution.WorkflowExecutor;
Expand Down Expand Up @@ -65,7 +64,6 @@ public class KafkaPublishTask extends WorkflowSystemTask {
private final String requestParameter;
private final KafkaProducerManager producerManager;

@Autowired
public KafkaPublishTask(KafkaProducerManager clientManager, ObjectMapper objectMapper) {
super(TASK_TYPE_KAFKA_PUBLISH);
this.requestParameter = REQUEST_PARAMETER_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.netflix.conductor.common.metadata.tasks.TaskDef;
Expand All @@ -40,7 +39,6 @@ public class KafkaPublishTaskMapper implements TaskMapper {
private final ParametersUtils parametersUtils;
private final MetadataDAO metadataDAO;

@Autowired
public KafkaPublishTaskMapper(ParametersUtils parametersUtils, MetadataDAO metadataDAO) {
this.parametersUtils = parametersUtils;
this.metadataDAO = metadataDAO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.time.Duration;
import java.time.temporal.ChronoUnit;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;

import org.springframework.boot.convert.DurationUnit;
import org.springframework.core.env.Environment;
Expand All @@ -24,7 +23,6 @@ public class ArchivingWorkflowListenerProperties {

private final Environment environment;

@Autowired
public ArchivingWorkflowListenerProperties(Environment environment) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public ArchivingWorkflowListenerProperties(Environment environment) {
@Autowired
public ArchivingWorkflowListenerProperties(Environment environment) {

this.environment = environment;
}
Expand Down