New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method LicenseInfoFactory::getListedLicenseById
never returns null
#238
Comments
Thanks @dwalluck for pointing this out. I looked at the code, and it looks like it will create the license if it doesn't exist based on this method which defaults to creating the class. There are a couple possible solutions - check before return or catch the error with create=false (a higher performance solution). I can take a look at a solution after implementing the SPDX 3.0 support - or if you'd like to create a PR, I can review / merge. |
`ListedLicenses::getListedLicenseById` and `ListedLicenses::getListedExceptionById` should return `null` if ID does not exist. Resolves spdxGH-238 Signed-off-by: David Walluck <dwalluck@redhat.com>
`ListedLicenses::getListedLicenseById` and `ListedLicenses::getListedExceptionById` should return `null` if ID does not exist. Resolves spdxGH-238 Signed-off-by: David Walluck <dwalluck@redhat.com>
`ListedLicenses::getListedLicenseById` and `ListedLicenses::getListedExceptionById` should return `null` if ID does not exist. Resolves spdxGH-238 Signed-off-by: David Walluck <dwalluck@redhat.com>
`ListedLicenses::getListedLicenseById` and `ListedLicenses::getListedExceptionById` should return `null` if ID does not exist. Resolves spdxGH-238 Signed-off-by: David Walluck <dwalluck@redhat.com>
The javadoc for
LicenseInfoFactory::getListedLicenseById
states that it returns the "SPDX listed license ornull
if the ID is not in the SPDX license list". But, it looks like that for any value I pass in, it seems to return aSpdxListedLicense
with theid
set to that value (licenseId
).Therefore, instead of simply calling this method, I must check whether
licenseId
is contained inLicenseInfoFactory::getSpdxListedLicenseIds
before calling the method.The text was updated successfully, but these errors were encountered: