openrewrite / rewrite-migrate-java

OpenRewrite recipes for migrating to newer versions of Java.
Apache License 2.0
111 stars 75 forks source link

Prevent breakage of usages of Spring's @Nullable #602

Closed kmccarp closed 2 weeks ago

kmccarp commented 2 weeks ago

What's changed?

I commented out the migration from @org.springframework.lang.Nullable to @org.jspecify.annotations.Nullable.

What's your motivation?

Spring treats its @Nullable differently from JSpecify's @Nullable, and for custom prometheus scrape endpoints, if you pass in @org.jspecify.annotations.Nullable Set<String> includedNames and includedNames is null, the entire scrape will fail.

Anything in particular you'd like reviewers to focus on?

N/A

Anyone you would like to review specifically?

N/A

Have you considered any alternatives or workarounds?

The workaround considered was forking or not using the MigrateToJSpecify recipe, but we would prefer to use the recipe.

Any additional context

Checklist