diff --git a/src/main/java/org/openrewrite/java/migrate/joda/templates/TimeClassMap.java b/src/main/java/org/openrewrite/java/migrate/joda/templates/TimeClassMap.java index 80fbaeb52..4fbc099cb 100644 --- a/src/main/java/org/openrewrite/java/migrate/joda/templates/TimeClassMap.java +++ b/src/main/java/org/openrewrite/java/migrate/joda/templates/TimeClassMap.java @@ -15,6 +15,7 @@ */ package org.openrewrite.java.migrate.joda.templates; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.JavaType; import java.util.HashMap; @@ -48,11 +49,11 @@ private static JavaType.Class javaTypeClass(String fqn, JavaType.Class superType null, null, null, null, null); } - public static JavaType.Class getJavaTimeType(String typeFqn) { + public static @Nullable JavaType.Class getJavaTimeType(String typeFqn) { return new TimeClassMap().jodaToJavaTimeMap.get(typeFqn); } - public static String getJavaTimeShortName(String typeFqn) { + public static @Nullable String getJavaTimeShortName(String typeFqn) { return new TimeClassMap().jodaToJavaTimeShortName.get(typeFqn); } } diff --git a/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java b/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java index 4934c9f61..e156c90e2 100644 --- a/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java +++ b/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java @@ -18,6 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; import org.openrewrite.Recipe; @@ -62,8 +63,9 @@ public TreeVisitor getVisitor() { new UsesType<>(JAVA_UTIL_ZIP_INFLATER, false), new UsesType<>(JAVA_UTIL_ZIP_ZIP_FILE, false))), new JavaVisitor() { + @Override - public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + public @Nullable J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { J.MethodInvocation mi = (J.MethodInvocation) super.visitMethodInvocation(method, ctx); if (METHOD_MATCHER.matches(mi)) {