Skip to content

Commit

Permalink
Replace initializations of default lists with List.of() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
graben committed Jan 1, 2024
1 parent c60c359 commit d227265
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package dev.snowdrop.boot.narayana.core.properties;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
Expand Down Expand Up @@ -86,10 +83,10 @@ public class NarayanaProperties {
/**
* Comma-separated list of orphan filters.
*/
private List<String> xaResourceOrphanFilters = new ArrayList<>(Arrays.asList(
private List<String> xaResourceOrphanFilters = List.of(
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter",
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter",
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTAActionStatusServiceXAResourceOrphanFilter"));
"com.arjuna.ats.internal.jta.recovery.arjunacore.JTAActionStatusServiceXAResourceOrphanFilter");

/**
* Wrapping plugin to map from XAResourceWrapper to XAResourceRecord.
Expand All @@ -104,22 +101,22 @@ public class NarayanaProperties {
/**
* JNDI names of CommitMarkableResource instances.
*/
private List<String> commitMarkableResourceJNDINames = new ArrayList<>();
private List<String> commitMarkableResourceJNDINames = List.of();

/**
* Comma-separated list of recovery modules.
*/
private List<String> recoveryModules = new ArrayList<>(Arrays.asList(
private List<String> recoveryModules = List.of(
"com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule",
"com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule",
"com.arjuna.ats.internal.txoj.recovery.TORecoveryModule",
"com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule"));
"com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule");

/**
* Comma-separated list of expiry scanners.
*/
private List<String> expiryScanners = new ArrayList<>(Collections.singletonList(
"com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"));
private List<String> expiryScanners = List.of(
"com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner");

/**
* MessagingHub specific properties used if pooled connection factory wrapper is enabled.
Expand All @@ -131,7 +128,7 @@ public class NarayanaProperties {
/**
* XA recovery nodes.
*/
private List<String> xaRecoveryNodes = new ArrayList<>(Arrays.asList("1"));
private List<String> xaRecoveryNodes = List.of("1");

public String getLogDir() {
return this.logDir;
Expand Down

0 comments on commit d227265

Please sign in to comment.