fix: don't allow qualifiers to contain nullable values#231
Open
dwalluck wants to merge 2 commits intopackage-url:masterfrom
Open
fix: don't allow qualifiers to contain nullable values#231dwalluck wants to merge 2 commits intopackage-url:masterfrom
dwalluck wants to merge 2 commits intopackage-url:masterfrom
Conversation
This fixes the warning "Assigning a collection of nullable elements into a collection of non-null elements" which was a difference between what `PurlParameters::getQualifiers` returns and what `PackageURL::new` expects. So far, we don't have an example of qualifiers with `null` elements, but we can just return `"null"` instead which should have the same effect when comparing values. Simplify the creation of the qualifiers map from the `JSONObject` by using `Collectors::toMap`.
Contributor
|
I think there are test cases, where the value assigned to a key is In test cases, nullability warnings are bound to happen: we want to test what happens if the consumer does not check the JSpecify annotations and passes a If the value is |
Contributor
Author
|
No problem, |
ppkarwasz
approved these changes
Apr 3, 2025
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.
This fixes the warning "Assigning a collection of nullable elements into a collection of non-null elements" which was a difference between what
PurlParameters::getQualifiersreturns and whatPackageURL::newexpects. So far, we don't have an example of qualifiers withnullelements, but we can just return"null"instead which should have the same effect when comparing values.Simplify the creation of the qualifiers map from the
JSONObjectby usingCollectors::toMap.