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

Fixes from static code analysis #126

Merged
merged 1 commit into from
Jan 5, 2024
Merged
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 @@ -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