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