Merge branch '3.2.x' into 3.3.x

Closes gh-42107
This commit is contained in:
Phillip Webb
2024-09-03 12:09:51 -07:00
2 changed files with 22 additions and 4 deletions

View File

@@ -440,7 +440,12 @@ public class Restarter {
}
public Object getOrAddAttribute(String name, final ObjectFactory<?> objectFactory) {
return this.attributes.computeIfAbsent(name, (ignore) -> objectFactory.getObject());
Object value = this.attributes.get(name);
if (value == null) {
value = objectFactory.getObject();
this.attributes.put(name, value);
}
return value;
}
public Object removeAttribute(String name) {