From d7a55e76f5be7e30c0da63ea4d329d95cff4982f Mon Sep 17 00:00:00 2001 From: tiffany jernigan Date: Mon, 8 Jan 2024 23:21:06 +0100 Subject: [PATCH] Remove unnecessary Autowired from Constructors --- .../java/com/netflix/conductor/core/events/EventQueues.java | 2 -- .../conductor/core/execution/mapper/DoWhileTaskMapper.java | 2 -- .../conductor/core/execution/mapper/DynamicTaskMapper.java | 2 -- .../conductor/core/execution/mapper/EventTaskMapper.java | 2 -- .../core/execution/mapper/ForkJoinDynamicTaskMapper.java | 2 -- .../netflix/conductor/core/execution/mapper/HTTPTaskMapper.java | 2 -- .../conductor/core/execution/mapper/KafkaPublishTaskMapper.java | 2 -- .../conductor/core/execution/mapper/SwitchTaskMapper.java | 2 -- .../netflix/conductor/core/reconciliation/WorkflowSweeper.java | 2 -- .../com/netflix/conductor/service/ExecutionLockService.java | 2 -- .../tasks/http/providers/DefaultRestTemplateProvider.java | 2 -- .../java/com/netflix/conductor/tasks/json/JsonJqTransform.java | 2 -- .../conductor/contribs/tasks/kafka/KafkaProducerManager.java | 2 -- .../conductor/contribs/tasks/kafka/KafkaPublishTask.java | 2 -- .../conductor/core/execution/mapper/KafkaPublishTaskMapper.java | 2 -- .../com/netflix/conductor/redis/config/RedisProperties.java | 2 -- .../conductor/test/utils/MockExternalPayloadStorage.java | 2 -- .../test/java/com/netflix/conductor/test/utils/UserTask.java | 2 -- .../listener/archive/ArchivingWorkflowListenerProperties.java | 2 -- 19 files changed, 38 deletions(-) diff --git a/core/src/main/java/com/netflix/conductor/core/events/EventQueues.java b/core/src/main/java/com/netflix/conductor/core/events/EventQueues.java index 9cbe08a46..139aad0c4 100644 --- a/core/src/main/java/com/netflix/conductor/core/events/EventQueues.java +++ b/core/src/main/java/com/netflix/conductor/core/events/EventQueues.java @@ -18,7 +18,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.lang.NonNull; import org.springframework.stereotype.Component; @@ -37,7 +36,6 @@ public class EventQueues { private final ParametersUtils parametersUtils; private final Map providers; - @Autowired public EventQueues( @Qualifier(EVENT_QUEUE_PROVIDERS_QUALIFIER) Map providers, ParametersUtils parametersUtils) { diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java index 85ff93e81..054d854de 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java @@ -18,7 +18,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; @@ -42,7 +41,6 @@ public class DoWhileTaskMapper implements TaskMapper { private final MetadataDAO metadataDAO; private final ParametersUtils parametersUtils; - @Autowired public DoWhileTaskMapper(MetadataDAO metadataDAO, ParametersUtils parametersUtils) { this.metadataDAO = metadataDAO; this.parametersUtils = parametersUtils; diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DynamicTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DynamicTaskMapper.java index d94af8f0b..4ab0480d8 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DynamicTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DynamicTaskMapper.java @@ -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.annotations.VisibleForTesting; @@ -46,7 +45,6 @@ public class DynamicTaskMapper implements TaskMapper { private final ParametersUtils parametersUtils; private final MetadataDAO metadataDAO; - @Autowired public DynamicTaskMapper(ParametersUtils parametersUtils, MetadataDAO metadataDAO) { this.parametersUtils = parametersUtils; this.metadataDAO = metadataDAO; diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/EventTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/EventTaskMapper.java index 96b9d582f..0ec323530 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/EventTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/EventTaskMapper.java @@ -17,7 +17,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.TaskType; @@ -35,7 +34,6 @@ public class EventTaskMapper implements TaskMapper { private final ParametersUtils parametersUtils; - @Autowired public EventTaskMapper(ParametersUtils parametersUtils) { this.parametersUtils = parametersUtils; } diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java index 8eed7a00d..113f9b41d 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java @@ -25,7 +25,6 @@ import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import com.netflix.conductor.annotations.VisibleForTesting; @@ -68,7 +67,6 @@ public class ForkJoinDynamicTaskMapper implements TaskMapper { private static final TypeReference> ListOfWorkflowTasks = new TypeReference<>() {}; - @Autowired public ForkJoinDynamicTaskMapper( IDGenerator idGenerator, ParametersUtils parametersUtils, diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/HTTPTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/HTTPTaskMapper.java index 837e49549..4ac2bb4b8 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/HTTPTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/HTTPTaskMapper.java @@ -16,7 +16,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; @@ -42,7 +41,6 @@ public class HTTPTaskMapper implements TaskMapper { private final ParametersUtils parametersUtils; private final MetadataDAO metadataDAO; - @Autowired public HTTPTaskMapper(ParametersUtils parametersUtils, MetadataDAO metadataDAO) { this.parametersUtils = parametersUtils; this.metadataDAO = metadataDAO; diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java index 862504666..455e337f2 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java @@ -20,7 +20,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; @@ -41,7 +40,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; diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java index 2401b5c2c..b59f861b7 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java @@ -18,7 +18,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.TaskType; @@ -42,7 +41,6 @@ public class SwitchTaskMapper implements TaskMapper { private final Map evaluators; - @Autowired public SwitchTaskMapper(Map evaluators) { this.evaluators = evaluators; } diff --git a/core/src/main/java/com/netflix/conductor/core/reconciliation/WorkflowSweeper.java b/core/src/main/java/com/netflix/conductor/core/reconciliation/WorkflowSweeper.java index a83ea4d39..b12529a62 100644 --- a/core/src/main/java/com/netflix/conductor/core/reconciliation/WorkflowSweeper.java +++ b/core/src/main/java/com/netflix/conductor/core/reconciliation/WorkflowSweeper.java @@ -19,7 +19,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; @@ -53,7 +52,6 @@ public class WorkflowSweeper { private static final String CLASS_NAME = WorkflowSweeper.class.getSimpleName(); - @Autowired public WorkflowSweeper( WorkflowExecutor workflowExecutor, Optional workflowRepairService, diff --git a/core/src/main/java/com/netflix/conductor/service/ExecutionLockService.java b/core/src/main/java/com/netflix/conductor/service/ExecutionLockService.java index b7539ca4d..d9dbf6b7b 100644 --- a/core/src/main/java/com/netflix/conductor/service/ExecutionLockService.java +++ b/core/src/main/java/com/netflix/conductor/service/ExecutionLockService.java @@ -16,7 +16,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.netflix.conductor.annotations.Trace; @@ -34,7 +33,6 @@ public class ExecutionLockService { private final long lockLeaseTime; private final long lockTimeToTry; - @Autowired public ExecutionLockService(ConductorProperties properties, Lock lock) { this.properties = properties; this.lock = lock; diff --git a/http-task/src/main/java/com/netflix/conductor/tasks/http/providers/DefaultRestTemplateProvider.java b/http-task/src/main/java/com/netflix/conductor/tasks/http/providers/DefaultRestTemplateProvider.java index 0efae0591..b37770f69 100644 --- a/http-task/src/main/java/com/netflix/conductor/tasks/http/providers/DefaultRestTemplateProvider.java +++ b/http-task/src/main/java/com/netflix/conductor/tasks/http/providers/DefaultRestTemplateProvider.java @@ -18,7 +18,6 @@ import org.apache.hc.core5.http.io.SocketConfig; import org.apache.hc.core5.util.Timeout; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; @@ -40,7 +39,6 @@ public class DefaultRestTemplateProvider implements RestTemplateProvider { private final int defaultReadTimeout; private final int defaultConnectTimeout; - @Autowired public DefaultRestTemplateProvider( @Value("${conductor.tasks.http.readTimeout:150ms}") Duration readTimeout, @Value("${conductor.tasks.http.connectTimeout:100ms}") Duration connectTimeout) { diff --git a/json-jq-task/src/main/java/com/netflix/conductor/tasks/json/JsonJqTransform.java b/json-jq-task/src/main/java/com/netflix/conductor/tasks/json/JsonJqTransform.java index 583b2f492..afae74b39 100644 --- a/json-jq-task/src/main/java/com/netflix/conductor/tasks/json/JsonJqTransform.java +++ b/json-jq-task/src/main/java/com/netflix/conductor/tasks/json/JsonJqTransform.java @@ -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.core.execution.WorkflowExecutor; @@ -51,7 +50,6 @@ public class JsonJqTransform extends WorkflowSystemTask { private final ObjectMapper objectMapper; private final LoadingCache queryCache = createQueryCache(); - @Autowired public JsonJqTransform(ObjectMapper objectMapper) { super(NAME); this.objectMapper = objectMapper; diff --git a/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaProducerManager.java b/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaProducerManager.java index 013f83ed9..7eccad462 100644 --- a/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaProducerManager.java +++ b/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaProducerManager.java @@ -24,7 +24,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; @@ -53,7 +52,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, diff --git a/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaPublishTask.java b/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaPublishTask.java index 0a7377d8e..b446174c1 100644 --- a/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaPublishTask.java +++ b/kafka/src/main/java/com/netflix/conductor/contribs/tasks/kafka/KafkaPublishTask.java @@ -31,7 +31,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; @@ -66,7 +65,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; diff --git a/kafka/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java b/kafka/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java index f9926e459..d68982ae1 100644 --- a/kafka/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java +++ b/kafka/src/main/java/com/netflix/conductor/core/execution/mapper/KafkaPublishTaskMapper.java @@ -20,7 +20,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; @@ -41,7 +40,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; diff --git a/redis-persistence/src/main/java/com/netflix/conductor/redis/config/RedisProperties.java b/redis-persistence/src/main/java/com/netflix/conductor/redis/config/RedisProperties.java index 7813e5519..db54d5e69 100644 --- a/redis-persistence/src/main/java/com/netflix/conductor/redis/config/RedisProperties.java +++ b/redis-persistence/src/main/java/com/netflix/conductor/redis/config/RedisProperties.java @@ -15,7 +15,6 @@ import java.time.Duration; import java.time.temporal.ChronoUnit; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.convert.DurationUnit; @@ -30,7 +29,6 @@ public class RedisProperties { private final ConductorProperties conductorProperties; - @Autowired public RedisProperties(ConductorProperties conductorProperties) { this.conductorProperties = conductorProperties; } diff --git a/test-harness/src/test/java/com/netflix/conductor/test/utils/MockExternalPayloadStorage.java b/test-harness/src/test/java/com/netflix/conductor/test/utils/MockExternalPayloadStorage.java index 18efe513e..c1d57ae86 100644 --- a/test-harness/src/test/java/com/netflix/conductor/test/utils/MockExternalPayloadStorage.java +++ b/test-harness/src/test/java/com/netflix/conductor/test/utils/MockExternalPayloadStorage.java @@ -23,7 +23,6 @@ import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Component; @@ -48,7 +47,6 @@ public class MockExternalPayloadStorage implements ExternalPayloadStorage { private final ObjectMapper objectMapper; private final File payloadDir; - @Autowired public MockExternalPayloadStorage(ObjectMapper objectMapper) throws IOException { this.objectMapper = objectMapper; this.payloadDir = Files.createTempDirectory("payloads").toFile(); diff --git a/test-harness/src/test/java/com/netflix/conductor/test/utils/UserTask.java b/test-harness/src/test/java/com/netflix/conductor/test/utils/UserTask.java index ae1fc9ac9..2c369390d 100644 --- a/test-harness/src/test/java/com/netflix/conductor/test/utils/UserTask.java +++ b/test-harness/src/test/java/com/netflix/conductor/test/utils/UserTask.java @@ -20,7 +20,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.core.execution.WorkflowExecutor; @@ -44,7 +43,6 @@ public class UserTask extends WorkflowSystemTask { private static final TypeReference>>> mapStringListObjects = new TypeReference<>() {}; - @Autowired public UserTask(ObjectMapper objectMapper) { super(NAME); this.objectMapper = objectMapper; diff --git a/workflow-event-listener/src/main/java/com/netflix/conductor/contribs/listener/archive/ArchivingWorkflowListenerProperties.java b/workflow-event-listener/src/main/java/com/netflix/conductor/contribs/listener/archive/ArchivingWorkflowListenerProperties.java index 7e2fad5cb..d600c14e6 100644 --- a/workflow-event-listener/src/main/java/com/netflix/conductor/contribs/listener/archive/ArchivingWorkflowListenerProperties.java +++ b/workflow-event-listener/src/main/java/com/netflix/conductor/contribs/listener/archive/ArchivingWorkflowListenerProperties.java @@ -15,7 +15,6 @@ import java.time.Duration; import java.time.temporal.ChronoUnit; -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; @@ -25,7 +24,6 @@ public class ArchivingWorkflowListenerProperties { private final Environment environment; - @Autowired public ArchivingWorkflowListenerProperties(Environment environment) { this.environment = environment; }