From adbbc9cdf0bfd4af1c5bcc7c818f9beef2172623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Schn=C3=A9ider?= Date: Thu, 15 Aug 2024 04:20:12 +0000 Subject: [PATCH] Migrate to JSpecify from OpenRewrite JSR-305 meta-annotations Use this link to re-run the recipe: https://app.moderne.io/builder/gW3xaSLWV?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- src/main/java/org/openrewrite/nodejs/Dependency.java | 2 +- .../openrewrite/nodejs/DependencyVulnerabilityCheck.java | 2 +- .../java/org/openrewrite/nodejs/NodeResolutionResult.java | 2 +- src/main/java/org/openrewrite/nodejs/NpmExecutor.java | 2 +- .../java/org/openrewrite/nodejs/ResolvedDependency.java | 2 +- src/main/java/org/openrewrite/nodejs/package-info.java | 6 ++---- .../org/openrewrite/nodejs/search/DependencyInsight.java | 2 +- .../java/org/openrewrite/nodejs/search/IsPackageJson.java | 2 +- .../org/openrewrite/nodejs/search/IsPackageLockJson.java | 2 +- .../java/org/openrewrite/nodejs/search/package-info.java | 6 ++---- .../java/org/openrewrite/nodejs/table/package-info.java | 6 ++---- 11 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/openrewrite/nodejs/Dependency.java b/src/main/java/org/openrewrite/nodejs/Dependency.java index 74356ad..51ad2c6 100644 --- a/src/main/java/org/openrewrite/nodejs/Dependency.java +++ b/src/main/java/org/openrewrite/nodejs/Dependency.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.experimental.NonFinal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.semver.VersionComparator; @Value diff --git a/src/main/java/org/openrewrite/nodejs/DependencyVulnerabilityCheck.java b/src/main/java/org/openrewrite/nodejs/DependencyVulnerabilityCheck.java index 3c26545..d6bb557 100644 --- a/src/main/java/org/openrewrite/nodejs/DependencyVulnerabilityCheck.java +++ b/src/main/java/org/openrewrite/nodejs/DependencyVulnerabilityCheck.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.JsonIsoVisitor; import org.openrewrite.json.JsonPathMatcher; import org.openrewrite.json.tree.Json; diff --git a/src/main/java/org/openrewrite/nodejs/NodeResolutionResult.java b/src/main/java/org/openrewrite/nodejs/NodeResolutionResult.java index 3ebd326..681972e 100644 --- a/src/main/java/org/openrewrite/nodejs/NodeResolutionResult.java +++ b/src/main/java/org/openrewrite/nodejs/NodeResolutionResult.java @@ -22,8 +22,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.tree.Json; import org.openrewrite.semver.Semver; import org.openrewrite.semver.VersionComparator; diff --git a/src/main/java/org/openrewrite/nodejs/NpmExecutor.java b/src/main/java/org/openrewrite/nodejs/NpmExecutor.java index 4185aba..6f53d64 100644 --- a/src/main/java/org/openrewrite/nodejs/NpmExecutor.java +++ b/src/main/java/org/openrewrite/nodejs/NpmExecutor.java @@ -18,7 +18,7 @@ import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.shell.exec.ShellExecutor; import java.nio.file.Path; diff --git a/src/main/java/org/openrewrite/nodejs/ResolvedDependency.java b/src/main/java/org/openrewrite/nodejs/ResolvedDependency.java index ebe9e2e..d353717 100644 --- a/src/main/java/org/openrewrite/nodejs/ResolvedDependency.java +++ b/src/main/java/org/openrewrite/nodejs/ResolvedDependency.java @@ -16,7 +16,7 @@ package org.openrewrite.nodejs; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/src/main/java/org/openrewrite/nodejs/package-info.java b/src/main/java/org/openrewrite/nodejs/package-info.java index 3f37d06..cef9e3c 100644 --- a/src/main/java/org/openrewrite/nodejs/package-info.java +++ b/src/main/java/org/openrewrite/nodejs/package-info.java @@ -13,10 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.nodejs; - -// We annotate the package to indicate that fields and methods in this package are non-null by default. -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/src/main/java/org/openrewrite/nodejs/search/DependencyInsight.java b/src/main/java/org/openrewrite/nodejs/search/DependencyInsight.java index 3e85200..8275d70 100644 --- a/src/main/java/org/openrewrite/nodejs/search/DependencyInsight.java +++ b/src/main/java/org/openrewrite/nodejs/search/DependencyInsight.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.JsonIsoVisitor; import org.openrewrite.json.JsonPathMatcher; import org.openrewrite.json.JsonVisitor; diff --git a/src/main/java/org/openrewrite/nodejs/search/IsPackageJson.java b/src/main/java/org/openrewrite/nodejs/search/IsPackageJson.java index 9b093b7..3d27041 100644 --- a/src/main/java/org/openrewrite/nodejs/search/IsPackageJson.java +++ b/src/main/java/org/openrewrite/nodejs/search/IsPackageJson.java @@ -15,9 +15,9 @@ */ package org.openrewrite.nodejs.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.tree.Json; import org.openrewrite.marker.SearchResult; diff --git a/src/main/java/org/openrewrite/nodejs/search/IsPackageLockJson.java b/src/main/java/org/openrewrite/nodejs/search/IsPackageLockJson.java index 8ac30a6..e930649 100644 --- a/src/main/java/org/openrewrite/nodejs/search/IsPackageLockJson.java +++ b/src/main/java/org/openrewrite/nodejs/search/IsPackageLockJson.java @@ -15,9 +15,9 @@ */ package org.openrewrite.nodejs.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.tree.Json; import org.openrewrite.marker.SearchResult; diff --git a/src/main/java/org/openrewrite/nodejs/search/package-info.java b/src/main/java/org/openrewrite/nodejs/search/package-info.java index df5e186..ac7ec43 100644 --- a/src/main/java/org/openrewrite/nodejs/search/package-info.java +++ b/src/main/java/org/openrewrite/nodejs/search/package-info.java @@ -13,11 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.nodejs.search; -// We annotate the package to indicate that fields and methods in this package are non-null by default. - -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/src/main/java/org/openrewrite/nodejs/table/package-info.java b/src/main/java/org/openrewrite/nodejs/table/package-info.java index a24cac5..b8922c2 100644 --- a/src/main/java/org/openrewrite/nodejs/table/package-info.java +++ b/src/main/java/org/openrewrite/nodejs/table/package-info.java @@ -13,10 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.nodejs.table; - -// We annotate the package to indicate that fields and methods in this package are non-null by default. -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields;