Skip to content
Merged
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
5 changes: 4 additions & 1 deletion src/main/resources/META-INF/rewrite/jspecify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ recipeList:
- org.openrewrite.java.jspecify.MigrateFromJavaxAnnotationApi
- org.openrewrite.java.jspecify.MigrateFromJakartaAnnotationApi
- org.openrewrite.java.jspecify.MigrateFromJetbrainsAnnotations
- org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations
# Running the following recipe on current versions of Spring can cause Spring to misunderstand a nullable field.
# For instance, a custom Prometheus scrape endpoint with @Nullable Set<String> includedNames will fail if
# includedNames is null and if @Nullable is @org.jspecify.annotations.Nullable.
# - org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations

---
type: specs.openrewrite.org/v1beta/recipe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;
import org.openrewrite.Issue;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
Expand Down Expand Up @@ -324,9 +325,13 @@ class Bar {
);
}

@Issue("https://github.com/openrewrite/rewrite-migrate-java/pull/602")
@Test
void migrateFromSpringFrameworkAnnotationsToJspecify() {
rewriteRun(
spec -> spec.recipeFromResource(
"/META-INF/rewrite/jspecify.yml",
"org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations"),
mavenProject("foo",
//language=java
srcMainJava(
Expand Down