GH-3469 New Sonar smell & volatile busyWaitMillis

Fixes https://github.com/spring-projects/spring-integration/issues/3469

* Fix new Sonar smells
* Mark `LockRegistryLeaderInitiator.busyWaitMillis` as `volatile`
so runtime changes (e.g. `RedisLockRegistryLeaderInitiatorTests`)
will make an immediate effect
This commit is contained in:
Artem Bilan
2021-01-21 14:55:14 -05:00
parent 58ce578a10
commit 8763c95622
17 changed files with 121 additions and 132 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 the original author or authors.
* Copyright 2016-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -54,7 +53,6 @@ public class RedisLockRegistryLeaderInitiatorTests extends RedisAvailableTests {
@Test
@RedisAvailable
@Ignore("Intermittent failures")
public void testDistributedLeaderElection() throws Exception {
RedisLockRegistry registry = new RedisLockRegistry(getConnectionFactoryForTest(), "LeaderInitiator");
registry.expireUnusedOlderThan(-1);