mirror of
https://gitee.com/dcren/initializr.git
synced 2025-05-04 12:48:02 +08:00
Avoid recursion in computeIfAbsent
This commit is contained in:
parent
e6489e774a
commit
eb811a557e
@ -244,13 +244,13 @@ public class ProjectRequest extends BasicProjectRequest {
|
||||
|
||||
private void resolveBom(InitializrMetadata metadata, String bomId,
|
||||
Version requestedVersion) {
|
||||
boms.computeIfAbsent(bomId, key -> {
|
||||
BillOfMaterials bom = metadata.getConfiguration().getEnv().getBoms().get(key)
|
||||
if (!boms.containsKey(bomId)) {
|
||||
BillOfMaterials bom = metadata.getConfiguration().getEnv().getBoms().get(bomId)
|
||||
.resolve(requestedVersion);
|
||||
bom.getAdditionalBoms()
|
||||
.forEach(id -> resolveBom(metadata, id, requestedVersion));
|
||||
return bom;
|
||||
});
|
||||
boms.put(bomId, bom);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user