diff --git a/src/main/java/org/openrewrite/java/dependencies/DependencyVulnerabilityCheck.java b/src/main/java/org/openrewrite/java/dependencies/DependencyVulnerabilityCheck.java index 0d7c211..37a10a7 100644 --- a/src/main/java/org/openrewrite/java/dependencies/DependencyVulnerabilityCheck.java +++ b/src/main/java/org/openrewrite/java/dependencies/DependencyVulnerabilityCheck.java @@ -166,7 +166,7 @@ public Map> upgrade public static class Vulnerabilities { Map> gavToVulnerabilities; - public Set computeIfAbsent(ResolvedGroupArtifactVersion gav, Function> mappingFunction) { + public @Nullable Set computeIfAbsent(ResolvedGroupArtifactVersion gav, Function> mappingFunction) { return gavToVulnerabilities.computeIfAbsent(gav, mappingFunction); } } diff --git a/src/main/java/org/openrewrite/java/dependencies/RemoveExpiredSuppressions.java b/src/main/java/org/openrewrite/java/dependencies/RemoveExpiredSuppressions.java index 7b81cd0..fd2481e 100644 --- a/src/main/java/org/openrewrite/java/dependencies/RemoveExpiredSuppressions.java +++ b/src/main/java/org/openrewrite/java/dependencies/RemoveExpiredSuppressions.java @@ -15,6 +15,7 @@ */ package org.openrewrite.java.dependencies; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; @@ -41,8 +42,9 @@ public String getDescription() { @Override public TreeVisitor getVisitor() { return new XmlIsoVisitor() { + @Override - public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { + public @Nullable Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { Xml.Tag t = super.visitTag(tag, ctx); if (X_PATH_MATCHER.matches(getCursor())) { Optional untilAttribute = t.getAttributes().stream() diff --git a/src/main/java/org/openrewrite/java/dependencies/internal/VersionParser.java b/src/main/java/org/openrewrite/java/dependencies/internal/VersionParser.java index 2824b42..a78b9ea 100644 --- a/src/main/java/org/openrewrite/java/dependencies/internal/VersionParser.java +++ b/src/main/java/org/openrewrite/java/dependencies/internal/VersionParser.java @@ -16,6 +16,8 @@ package org.openrewrite.java.dependencies.internal; +import org.jspecify.annotations.Nullable; + import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -27,7 +29,7 @@ public class VersionParser { public VersionParser() { } - public Version transform(String original) { + public @Nullable Version transform(String original) { return cache.computeIfAbsent(original, this::parse); }