fix(licenseinfo): accumulate all obligations per license in DOCX reports#3748
Open
Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Open
fix(licenseinfo): accumulate all obligations per license in DOCX reports#3748Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Aman-Cool wants to merge 1 commit intoeclipse-sw360:mainfrom
Conversation
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.
Contributor
Author
|
Hi @GMishx @Farooq-Fateh-Aftab ,Ran into this while exporting compliance reports. The DOCX generator overwrites obligations instead of accumulating them, so only the last obligation per license makes it into the report. Bit concerning since these are used for audits. Let me know if you need any changes. |
Member
|
@keerthi-bl please help test the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes silent discard of multiple obligations per license in DOCX compliance reports. The
fillComponentObligationsTable()method blindly overwrites instead of accumulating obligations, causing all but the last obligation for each license to vanish from generated reports.For Apache-2.0 with three obligations (Attribution, Distribution, Patent retaliation), only the last obligation appears in the report. The other two are silently lost with no error, warning, or log entry.
Related Issue
N/A
Changes Made
fillComponentObligationsTable()to usecomputeIfAbsent()instead ofput()LinkedHashMapto preserve document-defined obligation orderFile changed:
backend/licenseinfo/src/main/java/org/eclipse/sw360/licenseinfo/outputGenerators/DocxGenerator.java(3 lines)Testing
Impact
Checklist
git commit -s)fix(licenseinfo): accumulate all obligations per license in DOCX reportsAdditional Notes
This is a critical fix for compliance workflows. The bug causes legally-binding compliance reports to silently omit obligations, creating undetectable compliance gaps. The rendering code was already correct - only the accumulation logic was broken.