Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
<versions-maven-plugin.version>2.18.0</versions-maven-plugin.version>
<!-- Maven build plugins for quality checks -->
<error.prone.core.version>2.38.0</error.prone.core.version>
<nullaway.version>0.13.8</nullaway.version>
<jacoco.maven.plugin.version>0.8.13</jacoco.maven.plugin.version>
<palantir.java.format.version>2.58.0</palantir.java.format.version>
<spotbugs.maven.plugin.version>4.9.3.0</spotbugs.maven.plugin.version>
Expand Down Expand Up @@ -325,7 +326,11 @@
<!-- Error Prone plugin -->
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne -XepExcludedPaths:.*/generated-test-sources/.*</arg>
<arg>-Xplugin:ErrorProne
-XepExcludedPaths:.*/generated-test-sources/.*
-Xep:NullAway:ERROR
-XepOpt:NullAway:OnlyNullMarked=true
-XepOpt:NullAway:TreatGeneratedAsUnannotated=true</arg>
<!--
~ Due to a bug in IntelliJ IDEA, annotation processing MUST be enabled.
~ Failing to do so will cause IDEA to ignore the annotation processor path
Expand All @@ -344,13 +349,25 @@
<artifactId>error_prone_core</artifactId>
<version>${error.prone.core.version}</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>${nullaway.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
<executions>
<execution>
<id>default-testCompile</id>
<configuration>
<compilerArgs combine.children="append">
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>--should-stop=ifError=FLOW</arg>
<arg>-Xplugin:ErrorProne
-XepExcludedPaths:.*/generated-test-sources/.*
-XepOpt:NullAway:OnlyNullMarked=true
-Xep:NullAway:OFF</arg>
<arg>-proc:full</arg>
</compilerArgs>
<annotationProcessors>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/github/packageurl/PackageURL.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ private static void validateChars(String value, IntPredicate predicate, String c

private static @Nullable String validateNamespace(final String type, final @Nullable String value)
throws MalformedPackageURLException {
if (isEmpty(value)) {
if (value == null || value.isEmpty()) {
return null;
}
return validateNamespace(type, value.split("/"));
Expand Down Expand Up @@ -455,7 +455,7 @@ private static String validateName(final String type, final String value) throws
}

private static void validateKey(final @Nullable String value) throws MalformedPackageURLException {
if (isEmpty(value)) {
if (value == null || value.isEmpty()) {
throw new MalformedPackageURLException("Qualifier key is invalid: " + value);
}

Expand All @@ -471,7 +471,7 @@ private static void validateValue(final String key, final @Nullable String value
}

private static @Nullable String validateSubpath(final @Nullable String value) throws MalformedPackageURLException {
if (isEmpty(value)) {
if (value == null || value.isEmpty()) {
return null;
}
return validatePath(value.split("/"), true);
Expand Down
Loading