Skip to content

Handle InvalidLicenseExpression types converting from SPDX 2 to 3#407

Open
goneall wants to merge 1 commit intomasterfrom
issue406
Open

Handle InvalidLicenseExpression types converting from SPDX 2 to 3#407
goneall wants to merge 1 commit intomasterfrom
issue406

Conversation

@goneall
Copy link
Copy Markdown
Member

@goneall goneall commented Mar 31, 2026

Fixes #406

Fixes 406

Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
* @return an SPDX spec version 3 InvalidLicenseExpression
* @throws InvalidSPDXAnalysisException on any errors converting
*/
public InvalidLicenseExpression convertAndStore(org.spdx.library.model.v2.license.InvalidLicenseExpression fromInvalidExpression) throws InvalidSPDXAnalysisException {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public InvalidLicenseExpression convertAndStore(org.spdx.library.model.v2.license.InvalidLicenseExpression fromInvalidExpression) throws InvalidSPDXAnalysisException {
public InvalidLicenseExpression convertAndStore(org.spdx.library.model.v2.license.InvalidLicenseExpression fromInvalidLicenseExpression) throws InvalidSPDXAnalysisException {

Since this is a public API, should we keep the full name here?

(I see an example from ExtractedLicenseInfo -> fromExtractedLicenseInfo at line 802)

toObjectUri, "SimpleLicensing.InvalidLicenseExpression", copyManager, true, defaultUriPrefix);
toInvalidLicExpression.setCreationInfo(defaultCreationInfo);
toInvalidLicExpression.setMessage(fromInvalidExpression.getMessage());
toInvalidLicExpression.setLicenseExpression(fromInvalidExpression.getMessage());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about why we put the message from the SPDX v2 InvalidExpression.getMessage() to the SPDX v3 LicenseExpression.

Please ignore if this is intentional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SPDX Conversion from SPDX 2.X to SPDX 3.X fails if there is an InvalidLicenseExpression

2 participants