GH-3549: Fix minor SonarQube smells

Fixes https://github.com/spring-projects/spring-integration/issues/3549
This commit is contained in:
trungPa
2021-07-23 22:07:39 +07:00
committed by GitHub
parent bc8246d267
commit 9e512186ed
33 changed files with 77 additions and 77 deletions

View File

@@ -140,7 +140,7 @@ public class LockRegistryLeaderInitiator implements SmartLifecycle, DisposableBe
/**
* @see SmartLifecycle which is an extension of org.springframework.context.Phased
*/
private int phase = Integer.MAX_VALUE - 1000;
private int phase = Integer.MAX_VALUE - 1000; // NOSONAR magic number
/**
* Time in milliseconds to wait in between attempts to acquire the lock, if it is not

View File

@@ -44,7 +44,7 @@ public final class DefaultLockRegistry implements LockRegistry {
* mask 0xFF with 256 locks.
*/
public DefaultLockRegistry() {
this(0xFF);
this(0xFF); // NOSONAR magic number
}
/**
@@ -60,7 +60,7 @@ public final class DefaultLockRegistry implements LockRegistry {
*/
public DefaultLockRegistry(int mask) {
String bits = Integer.toBinaryString(mask);
Assert.isTrue(bits.length() < 32 && (mask == 0 || bits.lastIndexOf('0') < bits.indexOf('1')), "Mask must be a power of 2 - 1");
Assert.isTrue(bits.length() < 32 && (mask == 0 || bits.lastIndexOf('0') < bits.indexOf('1')), "Mask must be a power of 2 - 1"); // NOSONAR magic number
this.mask = mask;
int arraySize = this.mask + 1;
this.lockTable = new ReentrantLock[arraySize];