Skip to content

Commit

Permalink
Fixes from static code analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
graben committed Jan 4, 2024
1 parent cde714d commit 04d69a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@

package dev.snowdrop.boot.narayana.core.jms.pool;

import java.io.Serial;

import jakarta.jms.Connection;

import org.messaginghub.pooled.jms.JmsPoolXAConnectionFactory;

public class JmsPoolNarayanaConnectionFactory extends JmsPoolXAConnectionFactory {

@Serial
private static final long serialVersionUID = 1709204966732828338L;

private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@

package dev.snowdrop.boot.narayana.openshift.recovery;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

import io.fabric8.kubernetes.client.KubernetesClient;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
Expand All @@ -40,8 +39,8 @@ public class NarayanaRecoveryTerminationControllerAutoConfiguration {
@Bean(initMethod = "start", destroyMethod = "stop")
@DependsOn("recoveryManagerService")
@ConditionalOnMissingBean(NarayanaRecoveryTerminationController.class)
public NarayanaRecoveryTerminationController narayanaRecoveryTerminationController(PodStatusManager podStatusManager, Optional<List<ServiceShutdownController>> shutdownControllers, Optional<List<RecoveryErrorDetector>> recoveryErrorDetectors) {
return new NarayanaRecoveryTerminationController(podStatusManager, shutdownControllers.orElse(Collections.emptyList()), recoveryErrorDetectors.orElse(Collections.emptyList()));
public NarayanaRecoveryTerminationController narayanaRecoveryTerminationController(PodStatusManager podStatusManager, ObjectProvider<List<ServiceShutdownController>> shutdownControllers, ObjectProvider<List<RecoveryErrorDetector>> recoveryErrorDetectors) {
return new NarayanaRecoveryTerminationController(podStatusManager, shutdownControllers.getIfAvailable(List::of), recoveryErrorDetectors.getIfAvailable(List::of));
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void periodicCheck() throws Exception {
this.kubernetesClient.apps().statefulSets().withName(this.properties.getStatefulset()).scale(minReplicas);
LOG.info("Statefulset {} successfully scaled to {} replicas", this.properties.getStatefulset(), minReplicas);
} else if (replicas == 0) {
LOG.debug("StatefulSet {} is going to be shut down. Controller will not interfere", this.properties.getStatefulset(), replicas);
LOG.debug("StatefulSet {} is going to be shut down. Controller will not interfere", this.properties.getStatefulset());
} else {
LOG.debug("StatefulSet {} has a sufficient number of replicas: {} >= {}", this.properties.getStatefulset(), replicas, minReplicas);
}
Expand Down

0 comments on commit 04d69a9

Please sign in to comment.