Issue 1111-核心阻塞队列枚举 BlockingQueueTypeEnum.createBlockingQueue(String blockingQueueName, Integer capacity)抛出NPE问题修复 (#1117)

* fix the NPE about null Integer convert to int,change temCapacity's type from int to Integer

* refactor BlockingQueueTypeEnum
pull/1119/head
Kevin 1 year ago committed by GitHub
parent 275a8bfb92
commit ed16c905da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -234,11 +234,11 @@ public enum BlockingQueueTypeEnum {
.map(each -> each.generateBlockingQueue())
.findFirst()
.orElseGet(() -> {
int temCapacity = capacity;
Integer tempCapacity = capacity;
if (capacity == null || capacity <= 0) {
temCapacity = DEFAULT_CAPACITY;
tempCapacity = DEFAULT_CAPACITY;
}
return new LinkedBlockingQueue<T>(temCapacity);
return new LinkedBlockingQueue<T>(tempCapacity);
});
}

Loading…
Cancel
Save