You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-integration-core/src/main/java/org/springframework/integration/support/locks/DefaultLockRegistry.java
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@
31
31
*
32
32
* @author Oleg Zhurakousky
33
33
* @author Gary Russell
34
+
*
34
35
* @since 2.1.1
35
36
*
36
37
*/
@@ -41,15 +42,15 @@ public final class DefaultLockRegistry implements LockRegistry<Lock> {
41
42
privatefinalintmask;
42
43
43
44
/**
44
-
* Constructs a DefaultLockRegistry with the default
45
+
* Construct a DefaultLockRegistry with the default
45
46
* mask 0xFF with 256 locks.
46
47
*/
47
48
publicDefaultLockRegistry() {
48
49
this(0xFF); // NOSONAR magic number
49
50
}
50
51
51
52
/**
52
-
* Constructs a DefaultLockRegistry with the supplied
53
+
* Construct a DefaultLockRegistry with the supplied
53
54
* mask - the mask must have a value Math.pow(2, n) - 1 where n
54
55
* is 1 to 31, creating a hash of Math.pow(2, n) locks.
55
56
* <p> Examples:
@@ -61,7 +62,8 @@ public DefaultLockRegistry() {
61
62
*/
62
63
publicDefaultLockRegistry(intmask) {
63
64
Stringbits = Integer.toBinaryString(mask);
64
-
Assert.isTrue(bits.length() < 32 && (mask == 0 || bits.lastIndexOf('0') < bits.indexOf('1')), "Mask must be a power of 2 - 1"); // NOSONAR magic number
Copy file name to clipboardExpand all lines: spring-integration-core/src/test/java/org/springframework/integration/handler/advice/LockRequestHandlerAdviceTests.java
Copy file name to clipboardExpand all lines: spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/lock/JdbcLockRegistryTests.java
0 commit comments