Use Map.computeIfAbsent() where feasible
See gh-31916
This commit is contained in:
committed by
Stéphane Nicoll
parent
adcf236a3d
commit
ea5ef098cf
@@ -284,11 +284,7 @@ public class FactoryBeanTests {
|
||||
if (bean instanceof FactoryBean) {
|
||||
return bean;
|
||||
}
|
||||
AtomicInteger c = count.get(beanName);
|
||||
if (c == null) {
|
||||
c = new AtomicInteger();
|
||||
count.put(beanName, c);
|
||||
}
|
||||
AtomicInteger c = count.computeIfAbsent(beanName, k -> new AtomicInteger());
|
||||
c.incrementAndGet();
|
||||
return bean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user