We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cad079c commit 99dc791Copy full SHA for 99dc791
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultBootstrapContext.java
@@ -88,7 +88,12 @@ public <T> T get(Class<T> type) throws IllegalStateException {
88
synchronized (this.instanceSuppliers) {
89
InstanceSupplier<?> instanceSupplier = this.instanceSuppliers.get(type);
90
Assert.state(instanceSupplier != null, () -> type.getName() + " has not been registered");
91
- return (T) this.instances.computeIfAbsent(type, (key) -> instanceSupplier.get(this));
+ T instance = (T) this.instances.get(type);
92
+ if (instance == null) {
93
+ instance = (T) instanceSupplier.get(this);
94
+ this.instances.put(type, instance);
95
+ }
96
+ return instance;
97
}
98
99
0 commit comments