Skip to content

Commit 1111d4a

Browse files
committed
Migrate away from micrometer nullable annotations
1 parent 257d4bc commit 1111d4a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main/resources/META-INF/rewrite/jspecify.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ recipeList:
3939
- org.openrewrite.java.jspecify.MigrateFromJavaxAnnotationApi
4040
- org.openrewrite.java.jspecify.MigrateFromJakartaAnnotationApi
4141
- org.openrewrite.java.jspecify.MigrateFromJetbrainsAnnotations
42+
- org.openrewrite.java.jspecify.MigrateFromMicrometerAnnotations
4243
# Running the following recipe on current versions of Spring can cause Spring to misunderstand a nullable field.
4344
# For instance, a custom Prometheus scrape endpoint with @Nullable Set<String> includedNames will fail if
4445
# includedNames is null and if @Nullable is @org.jspecify.annotations.Nullable.
@@ -116,6 +117,28 @@ recipeList:
116117
annotationType: org.jspecify.annotations.*
117118
---
118119
type: specs.openrewrite.org/v1beta/recipe
120+
name: org.openrewrite.java.jspecify.MigrateFromMicrometerAnnotations
121+
displayName: Migrate from Micrometer annotations to JSpecify
122+
description: Migrate from Micrometer annotations to JSpecify.
123+
recipeList:
124+
- org.openrewrite.java.dependencies.AddDependency:
125+
groupId: org.jspecify
126+
artifactId: jspecify
127+
version: 1.0.0
128+
onlyIfUsing: org.springframework.lang.*ull*
129+
acceptTransitive: true
130+
- org.openrewrite.java.ChangeType:
131+
oldFullyQualifiedTypeName: io.micrometer.core.lang.Nullable
132+
newFullyQualifiedTypeName: org.jspecify.annotations.Nullable
133+
ignoreDefinition: true
134+
- org.openrewrite.java.ChangeType:
135+
oldFullyQualifiedTypeName: io.micrometer.core.lang.NonNull
136+
newFullyQualifiedTypeName: org.jspecify.annotations.NonNull
137+
ignoreDefinition: true
138+
- org.openrewrite.staticanalysis.java.MoveFieldAnnotationToType:
139+
annotationType: org.jspecify.annotations.*
140+
---
141+
type: specs.openrewrite.org/v1beta/recipe
119142
name: org.openrewrite.java.jspecify.MigrateFromSpringFrameworkAnnotations
120143
displayName: Migrate from Spring Framework annotations to JSpecify
121144
description: Migrate from Spring Framework annotations to JSpecify.

0 commit comments

Comments
 (0)