From 2d67f193f3bbb8a3be8d3e031c82ff0ae5634c27 Mon Sep 17 00:00:00 2001 From: Aman-Cool Date: Tue, 24 Feb 2026 03:06:42 +0530 Subject: [PATCH] fix(licenseinfo): accumulate all obligations per license in DOCX report Use computeIfAbsent to merge topic-text entries instead of overwriting, so multiple obligations referencing the same license ID are all included in the Additional Requirements table. --- .../sw360/licenseinfo/outputGenerators/DocxGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/licenseinfo/src/main/java/org/eclipse/sw360/licenseinfo/outputGenerators/DocxGenerator.java b/backend/licenseinfo/src/main/java/org/eclipse/sw360/licenseinfo/outputGenerators/DocxGenerator.java index 88783c4125..30593decc7 100644 --- a/backend/licenseinfo/src/main/java/org/eclipse/sw360/licenseinfo/outputGenerators/DocxGenerator.java +++ b/backend/licenseinfo/src/main/java/org/eclipse/sw360/licenseinfo/outputGenerators/DocxGenerator.java @@ -648,9 +648,9 @@ private void fillComponentObligationsTable(XWPFDocument document, .anyMatch(mlid -> mlid.equals(lid.replace("\n", "").replace("\r", ""))))) .forEach(o -> { o.getLicenseIDs().stream().forEach(lid -> { - Map oblTopicText = new HashMap(); - oblTopicText.put(o.getTopic(), o.getText()); - licenseIdToOblTopicText.put(lid, oblTopicText); + licenseIdToOblTopicText + .computeIfAbsent(lid, k -> new LinkedHashMap<>()) + .put(o.getTopic(), o.getText()); }); });