-
Notifications
You must be signed in to change notification settings - Fork 313
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
False InvalidLicenseChoiceException
for complex expression
#8082
Comments
The bug seems to be in |
…ions The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
…ions The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
@mmurto, I have a semi-off-topic question: Given |
Personally I'd prefer |
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
The original code was clearly wrong in that it recursively decomposed an expression and composed the contained expressions always with `AND` although there could be nested `OR` expressions. Instead, if there is a top-level `AND` in an expressions, create all combinations of choices on the left and choices on the right to get the total valid choices. Reword affected tests according to the fact that returned choices are not simplified, but explicit, though still deduplicated. Commonly introduce a `choice` variable along the way to make tests for long license expressions more readable. Fixes #8082. Signed-off-by: Sebastian Schuberth <[email protected]>
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
See [1] for context. [1]: #8082 (comment) Signed-off-by: Sebastian Schuberth <[email protected]>
I've verified that just using "MIT" in this case is actually already working. |
Expression
(MIT OR GPL-2.0-only) AND (MIT OR BSD-3-Clause OR GPL-1.0-or-later) AND (MIT OR BSD-3-Clause OR GPL-2.0-only)
doesn't allow choice ofMIT AND MIT AND MIT
, but throws the following exception:Caused by: org.ossreviewtoolkit.utils.spdx.InvalidLicenseChoiceException: MIT AND MIT AND MIT is not a valid choice for (MIT OR GPL-2.0-only) AND (MIT OR BSD-3-Clause OR GPL-1.0-or-later) AND (MIT OR BSD-3-Clause OR GPL-2.0-only). Valid choices are: [MIT AND BSD-3-Clause AND GPL-1.0-or-later, MIT AND BSD-3-Clause AND GPL-1.0-or-later AND GPL-2.0-only].
The text was updated successfully, but these errors were encountered: