spdx / Spdx-Java-Library

Java library which implements the Java object model for SPDX and provides useful helper functions
Apache License 2.0
32 stars 33 forks source link

LicenseCompareHelper: JavaMail license text not recognised #166

Closed pmonks closed 1 year ago

pmonks commented 1 year ago

The license text for JavaMail is not being correctly matched by org.spdx.utility.compare.LicenseCompareHelper.matchingStandardLicenseIdsWithinText() or org.spdx.utility.compare.LicenseCompareHelper.matchingStandardLicenseExceptionIdsWithinText(). This license text appears to be CDDL-1.1 OR GPL-2.0 WITH Classpath-exception-2.0, so I'd expect the former method to return ["CDDL-1.1", "GPL-2.0"] (or similar identifiers for GPL-2.0 - I realise there are several variants on each GPL license id that may all be matched simultaneously), and the latter method to return ["Classpath-exception-2.0"].

Note: tested with Spdx-Java-Library v1.1.5.

goneall commented 1 year ago

I found one issue in the library and one actual difference in the CDDL-1.1 license.

The library issue is related to the first non-optional text being an alt/var text. I created a pull request to resolve - PR #173

With this fix, the CDDL match is still failing. I noticed a section character in the JavaMail text that may be causing issues.

Since this is going to take some time to debug, it will probably have to wait until the next release of the libraries.

goneall commented 1 year ago

Here are the issues I found:

goneall commented 1 year ago

@pmonks since I fixed the one tool issue, I'll close this issue. We can open 2 separate issues in the license list XML if we want to add alt or optional text to fix the matching for the GPL-2.0 and Classpath-exception-2.0 texts.