packageurl-java
packageurl-java copied to clipboard
fix: don't allow qualifiers to contain nullable values
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.