From 582338e7d78e156feb2fd6af0ba12d9a588efb85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Schn=C3=A9ider?= Date: Thu, 15 Aug 2024 04:19:27 +0000 Subject: [PATCH 01/11] 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 --- .../benchmarks/java/package-info.java | 4 +- .../main/java/org/openrewrite/Checksum.java | 2 +- .../org/openrewrite/CreateFileVisitor.java | 4 +- .../src/main/java/org/openrewrite/Cursor.java | 2 +- .../DelegatingExecutionContext.java | 2 +- .../org/openrewrite/DeleteSourceFiles.java | 2 +- .../org/openrewrite/ExecutionContext.java | 2 +- .../java/org/openrewrite/FileAttributes.java | 2 +- .../openrewrite/FindCollidingSourceFiles.java | 2 +- .../org/openrewrite/FindGitProvenance.java | 2 +- .../org/openrewrite/FindParseFailures.java | 2 +- .../main/java/org/openrewrite/FindQuarks.java | 2 +- .../java/org/openrewrite/FindSourceFiles.java | 2 +- .../main/java/org/openrewrite/GitRemote.java | 2 +- .../openrewrite/InMemoryExecutionContext.java | 2 +- .../java/org/openrewrite/IsInRepository.java | 2 +- .../java/org/openrewrite/LargeSourceSet.java | 2 +- .../main/java/org/openrewrite/Maintainer.java | 2 +- .../org/openrewrite/ParseExceptionResult.java | 2 +- .../src/main/java/org/openrewrite/Parser.java | 2 +- .../main/java/org/openrewrite/PathUtils.java | 2 +- .../java/org/openrewrite/Preconditions.java | 2 +- .../org/openrewrite/PrintOutputCapture.java | 2 +- .../src/main/java/org/openrewrite/Recipe.java | 2 +- .../main/java/org/openrewrite/RecipeRun.java | 2 +- .../main/java/org/openrewrite/RenameFile.java | 2 +- .../src/main/java/org/openrewrite/Repeat.java | 2 +- .../src/main/java/org/openrewrite/Result.java | 6 +-- .../java/org/openrewrite/ScanningRecipe.java | 2 +- .../org/openrewrite/SetFilePermissions.java | 2 +- .../main/java/org/openrewrite/SourceFile.java | 2 +- .../src/main/java/org/openrewrite/Tree.java | 2 +- .../java/org/openrewrite/TreeObserver.java | 2 +- .../java/org/openrewrite/TreeVisitor.java | 2 +- .../main/java/org/openrewrite/Validated.java | 2 +- .../org/openrewrite/ValidationException.java | 2 +- .../org/openrewrite/ai/CodeEditResponse.java | 2 +- .../java/org/openrewrite/binary/Binary.java | 2 +- .../org/openrewrite/binary/BinaryParser.java | 2 +- .../org/openrewrite/binary/package-info.java | 4 +- .../org/openrewrite/config/CategoryTree.java | 2 +- .../config/ClasspathScanningLoader.java | 2 +- .../openrewrite/config/ColumnDescriptor.java | 2 +- .../openrewrite/config/DeclarativeRecipe.java | 2 +- .../openrewrite/config/OptionDescriptor.java | 2 +- .../openrewrite/config/RecipeDescriptor.java | 2 +- .../org/openrewrite/config/RecipeExample.java | 2 +- .../config/YamlResourceLoader.java | 2 +- .../org/openrewrite/config/package-info.java | 4 +- .../EncodingDetectingInputStream.java | 2 +- .../internal/InMemoryDiffEntry.java | 2 +- .../internal/InMemoryLargeSourceSet.java | 2 +- .../org/openrewrite/internal/ListUtils.java | 2 +- .../internal/LoggingMeterRegistry.java | 4 +- .../internal/PropertyPlaceholderHelper.java | 2 +- .../internal/RecipeIntrospectionUtils.java | 4 +- .../internal/RecipeRunException.java | 2 +- .../openrewrite/internal/ReflectionUtils.java | 2 +- .../org/openrewrite/internal/StringUtils.java | 4 +- .../openrewrite/internal/lang/NonNull.java | 5 +- .../openrewrite/internal/lang/NonNullApi.java | 2 + .../openrewrite/internal/lang/NullFields.java | 2 + .../openrewrite/internal/lang/NullUtils.java | 1 + .../openrewrite/internal/lang/Nullable.java | 5 +- .../openrewrite/internal/package-info.java | 4 +- .../openrewrite/marker/AlreadyReplaced.java | 2 +- .../openrewrite/marker/BuildToolFailure.java | 2 +- .../org/openrewrite/marker/CommitMessage.java | 2 +- .../org/openrewrite/marker/GitProvenance.java | 4 +- .../org/openrewrite/marker/LstProvenance.java | 2 +- .../java/org/openrewrite/marker/Markup.java | 2 +- .../marker/OperatingSystemProvenance.java | 4 +- .../org/openrewrite/marker/SearchResult.java | 2 +- .../marker/ci/BuildEnvironment.java | 2 +- .../marker/ci/JenkinsBuildEnvironment.java | 2 +- .../org/openrewrite/marker/package-info.java | 4 +- .../java/org/openrewrite/package-info.java | 4 +- .../java/org/openrewrite/quark/Quark.java | 2 +- .../org/openrewrite/quark/QuarkParser.java | 2 +- .../org/openrewrite/quark/package-info.java | 4 +- .../remote/LocalRemoteArtifactCache.java | 2 +- .../java/org/openrewrite/remote/Remote.java | 2 +- .../org/openrewrite/remote/RemoteArchive.java | 2 +- .../remote/RemoteArtifactCache.java | 2 +- .../org/openrewrite/remote/RemoteFile.java | 2 +- .../org/openrewrite/remote/package-info.java | 4 +- .../scheduling/RecipeRunCycle.java | 2 +- .../scheduling/WatchableExecutionContext.java | 2 +- .../openrewrite/scheduling/package-info.java | 4 +- .../openrewrite/search/FindBuildMetadata.java | 2 +- .../openrewrite/search/FindCommitters.java | 2 +- .../search/FindParseToPrintInequality.java | 2 +- .../org/openrewrite/search/package-info.java | 4 +- .../org/openrewrite/semver/CaretRange.java | 2 +- .../openrewrite/semver/DependencyMatcher.java | 2 +- .../org/openrewrite/semver/ExactVersion.java | 2 +- .../semver/ExactVersionWithPattern.java | 2 +- .../org/openrewrite/semver/HyphenRange.java | 2 +- .../openrewrite/semver/LatestIntegration.java | 2 +- .../org/openrewrite/semver/LatestPatch.java | 2 +- .../org/openrewrite/semver/LatestRelease.java | 2 +- .../java/org/openrewrite/semver/Semver.java | 2 +- .../java/org/openrewrite/semver/SetRange.java | 2 +- .../org/openrewrite/semver/TildeRange.java | 2 +- .../openrewrite/semver/VersionComparator.java | 2 +- .../java/org/openrewrite/semver/XRange.java | 2 +- .../org/openrewrite/semver/package-info.java | 4 +- .../org/openrewrite/style/NamedStyles.java | 2 +- .../org/openrewrite/style/package-info.java | 4 +- .../table/DeserializationErrorTable.java | 2 +- .../openrewrite/table/LstProvenanceTable.java | 2 +- .../org/openrewrite/table/ParseFailures.java | 2 +- .../table/ParseToPrintInequalities.java | 2 +- .../org/openrewrite/table/RecipeRunStats.java | 2 +- .../openrewrite/text/AppendToTextFile.java | 2 +- .../org/openrewrite/text/CreateTextFile.java | 2 +- .../text/EndOfLineAtEndOfFile.java | 2 +- .../main/java/org/openrewrite/text/Find.java | 2 +- .../org/openrewrite/text/FindAndReplace.java | 4 +- .../org/openrewrite/text/FindMultiselect.java | 2 +- .../java/org/openrewrite/text/PlainText.java | 2 +- .../org/openrewrite/text/PlainTextParser.java | 2 +- .../org/openrewrite/text/package-info.java | 4 +- .../openrewrite/trait/SimpleTraitMatcher.java | 2 +- .../org/openrewrite/trait/package-info.java | 4 +- .../java/org/openrewrite/tree/ParseError.java | 2 +- .../tree/ParsingExecutionContextView.java | 2 +- .../org/openrewrite/tree/package-info.java | 4 +- .../org/openrewrite/PreconditionsTest.java | 2 +- .../org/openrewrite/RecipeLifecycleTest.java | 2 +- .../org/openrewrite/RecipeSchedulerTest.java | 2 +- .../java/org/openrewrite/TreeVisitorTest.java | 2 +- .../config/DeclarativeRecipeTest.java | 4 +- .../lang/nonnull/DefaultNonNullTest.java | 2 +- .../internal/lang/nullable/NonNullTest.java | 2 +- .../java/org/openrewrite/package-info.java | 4 +- .../openrewrite/quark/QuarkParserTest.java | 2 +- .../java/org/openrewrite/quark/QuarkTest.java | 2 +- .../org/openrewrite/quark/package-info.java | 4 +- .../openrewrite/remote/RemoteVisitorTest.java | 2 +- .../org/openrewrite/table/package-info.java | 4 +- .../org/openrewrite/gradle/AddDependency.java | 2 +- .../gradle/AddDependencyVisitor.java | 2 +- .../org/openrewrite/gradle/AddProperty.java | 2 +- .../org/openrewrite/gradle/Assertions.java | 2 +- .../openrewrite/gradle/ChangeDependency.java | 2 +- .../gradle/ChangeDependencyArtifactId.java | 2 +- .../gradle/ChangeDependencyClassifier.java | 2 +- .../gradle/ChangeDependencyConfiguration.java | 2 +- .../gradle/ChangeDependencyExtension.java | 2 +- .../gradle/ChangeDependencyGroupId.java | 2 +- .../gradle/DependencyConstraintToRule.java | 2 +- .../gradle/DependencyUseStringNotation.java | 4 +- .../gradle/DependencyVersionSelector.java | 2 +- .../org/openrewrite/gradle/GradleParser.java | 2 +- .../org/openrewrite/gradle/IsBuildGradle.java | 2 +- .../openrewrite/gradle/IsSettingsGradle.java | 2 +- .../openrewrite/gradle/RemoveDependency.java | 2 +- .../gradle/UpdateGradleWrapper.java | 2 +- .../gradle/UpdateJavaCompatibility.java | 2 +- .../gradle/UpgradeDependencyVersion.java | 2 +- .../UpgradeTransitiveDependencyVersion.java | 2 +- .../gradle/marker/FeaturePreview.java | 2 +- .../marker/GradleDependencyConfiguration.java | 2 +- .../gradle/marker/GradlePluginDescriptor.java | 2 +- .../gradle/marker/GradleProject.java | 2 +- .../gradle/marker/GradleSettings.java | 2 +- .../gradle/marker/package-info.java | 4 +- .../org/openrewrite/gradle/package-info.java | 4 +- .../gradle/plugins/AddBuildPlugin.java | 2 +- .../plugins/AddDevelocityGradlePlugin.java | 4 +- .../gradle/plugins/AddPluginVisitor.java | 2 +- .../gradle/plugins/AddSettingsPlugin.java | 2 +- .../gradle/plugins/ChangePlugin.java | 2 +- .../gradle/plugins/ChangePluginVersion.java | 2 +- .../MigrateGradleEnterpriseToDevelocity.java | 8 +-- .../gradle/plugins/UpgradePluginVersion.java | 2 +- .../gradle/plugins/package-info.java | 4 +- .../gradle/search/DependencyInsight.java | 2 +- .../gradle/search/FindDependency.java | 2 +- .../gradle/search/FindGradleProject.java | 2 +- .../gradle/search/FindGradleWrapper.java | 2 +- .../gradle/search/FindPlugins.java | 2 +- .../gradle/search/FindRepository.java | 2 +- .../gradle/search/package-info.java | 4 +- .../gradle/security/package-info.java | 4 +- .../gradle/trait/GradleDependency.java | 2 +- .../gradle/trait/GradleTraitMatcher.java | 2 +- .../gradle/trait/package-info.java | 4 +- .../openrewrite/gradle/tree/GradlePlugin.java | 2 +- .../openrewrite/gradle/util/Dependency.java | 2 +- .../DependencyStringNotationConverter.java | 2 +- .../gradle/util/DistributionInfos.java | 2 +- .../gradle/util/GradleWrapper.java | 2 +- .../openrewrite/gradle/AddDependencyTest.java | 2 +- .../gradle/UpdateGradleWrapperTest.java | 2 +- .../org/openrewrite/gradle/package-info.java | 4 +- .../gradle/plugins/package-info.java | 4 +- .../gradle/search/package-info.java | 4 +- .../gradle/util/GradleWrapperTest.java | 2 +- .../openrewrite/gradle/util/package-info.java | 4 +- .../org/openrewrite/groovy/Assertions.java | 2 +- .../groovy/GroovyAstTypeSignatureBuilder.java | 2 +- .../org/openrewrite/groovy/GroovyParser.java | 2 +- .../groovy/GroovyParserVisitor.java | 6 +-- .../org/openrewrite/groovy/GroovyPrinter.java | 6 +-- .../openrewrite/groovy/GroovyTypeMapping.java | 10 ++-- .../org/openrewrite/groovy/GroovyVisitor.java | 2 +- .../groovy/format/AutoFormatVisitor.java | 2 +- .../format/MinimumViableSpacingVisitor.java | 2 +- ...renthesesForLastArgumentLambdaVisitor.java | 2 +- .../groovy/format/OmitParenthesesFormat.java | 2 +- .../groovy/format/package-info.java | 4 +- .../groovy/internal/package-info.java | 4 +- .../groovy/marker/package-info.java | 4 +- .../org/openrewrite/groovy/package-info.java | 4 +- .../service/GroovyAutoFormatService.java | 2 +- .../groovy/style/package-info.java | 4 +- .../java/org/openrewrite/groovy/tree/G.java | 2 +- .../openrewrite/groovy/tree/package-info.java | 4 +- .../groovy/GroovyTypeMappingTest.java | 2 +- .../java/org/openrewrite/hcl/Assertions.java | 2 +- .../java/org/openrewrite/hcl/HclParser.java | 2 +- .../java/org/openrewrite/hcl/HclVisitor.java | 2 +- .../org/openrewrite/hcl/JsonPathMatcher.java | 2 +- .../openrewrite/hcl/MoveContentToFile.java | 2 +- .../openrewrite/hcl/RandomizeIdVisitor.java | 2 +- .../hcl/format/AttributeSpaceVisitor.java | 2 +- .../hcl/format/AutoFormatVisitor.java | 2 +- .../hcl/format/BlankLinesVisitor.java | 2 +- .../hcl/format/BracketsVisitor.java | 2 +- .../openrewrite/hcl/format/SpacesVisitor.java | 2 +- .../hcl/format/TabsAndIndentsVisitor.java | 2 +- .../openrewrite/hcl/format/package-info.java | 4 +- .../hcl/internal/HclParserVisitor.java | 8 +-- .../openrewrite/hcl/internal/HclPrinter.java | 4 +- .../hcl/internal/package-info.java | 4 +- .../hcl/internal/template/Substitutions.java | 2 +- .../hcl/internal/template/package-info.java | 4 +- .../org/openrewrite/hcl/package-info.java | 4 +- .../hcl/search/FindAndReplaceLiteral.java | 2 +- .../openrewrite/hcl/search/package-info.java | 4 +- .../openrewrite/hcl/style/package-info.java | 4 +- .../java/org/openrewrite/hcl/tree/Hcl.java | 2 +- .../openrewrite/hcl/tree/HclContainer.java | 2 +- .../openrewrite/hcl/tree/HclCoordinates.java | 2 +- .../openrewrite/hcl/tree/HclLeftPadded.java | 2 +- .../openrewrite/hcl/tree/HclRightPadded.java | 2 +- .../java/org/openrewrite/hcl/tree/Space.java | 2 +- .../openrewrite/hcl/tree/package-info.java | 4 +- .../org/openrewrite/java/Java11Parser.java | 2 +- .../ReloadableJava11JavadocVisitor.java | 6 +-- .../java/isolated/ReloadableJava11Parser.java | 10 ++-- ...ReloadableJava11ParserInputFileObject.java | 2 +- .../ReloadableJava11ParserVisitor.java | 2 +- .../isolated/ReloadableJava11TypeMapping.java | 12 ++--- .../ReloadableJava11TypeSignatureBuilder.java | 2 +- .../org/openrewrite/java/Java17Parser.java | 2 +- .../ReloadableJava17JavadocVisitor.java | 6 +-- .../java/isolated/ReloadableJava17Parser.java | 6 +-- ...ReloadableJava17ParserInputFileObject.java | 2 +- .../ReloadableJava17ParserVisitor.java | 2 +- .../isolated/ReloadableJava17TypeMapping.java | 12 ++--- .../ReloadableJava17TypeSignatureBuilder.java | 2 +- .../java/isolated/package-info.java | 4 +- .../org/openrewrite/java/Java21Parser.java | 2 +- .../ReloadableJava21JavadocVisitor.java | 6 +-- .../java/isolated/ReloadableJava21Parser.java | 6 +-- ...ReloadableJava21ParserInputFileObject.java | 2 +- .../ReloadableJava21ParserVisitor.java | 2 +- .../isolated/ReloadableJava21TypeMapping.java | 12 ++--- .../ReloadableJava21TypeSignatureBuilder.java | 2 +- .../java/isolated/package-info.java | 4 +- .../org/openrewrite/java/Java8Parser.java | 2 +- .../java/Java8ParserInputFileObject.java | 2 +- .../java/ReloadableJava8JavadocVisitor.java | 10 ++-- .../java/ReloadableJava8Parser.java | 4 +- .../java/ReloadableJava8ParserVisitor.java | 4 +- .../java/ReloadableJava8TypeMapping.java | 12 ++--- .../ReloadableJava8TypeSignatureBuilder.java | 2 +- .../test/java/org/openrewrite/RepeatTest.java | 2 +- .../org/openrewrite/java/AddImportTest.java | 2 +- .../java/JavaTemplateInstanceOfTest.java | 2 +- .../ReplaceStringLiteralWithConstantTest.java | 2 +- .../java/UpdateSourcePositionsTest.java | 2 +- .../format/EmptyNewlineAtEndOfFileTest.java | 2 +- .../org/openrewrite/java/package-info.java | 4 +- .../java/search/IsOrIsNotLikelyTestTest.java | 2 +- .../java/org/openrewrite/java/AddImport.java | 2 +- .../openrewrite/java/AddLicenseHeader.java | 2 +- .../java/AddLiteralMethodArgument.java | 2 +- .../java/AddNullMethodArgument.java | 2 +- .../java/AddOrUpdateAnnotationAttribute.java | 2 +- .../openrewrite/java/AnnotationMatcher.java | 6 +-- .../java/org/openrewrite/java/Assertions.java | 2 +- .../org/openrewrite/java/ChangeFieldName.java | 2 +- .../java/ChangeMethodAccessLevel.java | 2 +- .../java/ChangeMethodAccessLevelVisitor.java | 5 +- .../openrewrite/java/ChangeMethodName.java | 2 +- .../java/ChangeMethodTargetToStatic.java | 2 +- .../java/ChangeMethodTargetToVariable.java | 2 +- .../org/openrewrite/java/ChangePackage.java | 6 +-- .../java/ChangeStaticFieldToMethod.java | 4 +- .../java/org/openrewrite/java/ChangeType.java | 14 ++--- .../openrewrite/java/CountLinesVisitor.java | 2 +- .../java/CreateEmptyJavaClass.java | 2 +- .../org/openrewrite/java/DeleteStatement.java | 2 +- .../openrewrite/java/ImplementInterface.java | 2 +- .../org/openrewrite/java/InvertCondition.java | 2 +- .../java/org/openrewrite/java/JavaParser.java | 2 +- .../org/openrewrite/java/JavaPrinter.java | 4 +- .../org/openrewrite/java/JavaTemplate.java | 2 +- .../java/JavaTemplateSemanticallyEqual.java | 2 +- .../org/openrewrite/java/JavaTypeMapping.java | 2 +- .../java/JavaTypeSignatureBuilder.java | 2 +- .../org/openrewrite/java/JavaTypeVisitor.java | 2 +- .../java/JavaUnrestrictedClassLoader.java | 2 +- .../org/openrewrite/java/JavaVisitor.java | 6 +-- .../org/openrewrite/java/JavadocPrinter.java | 4 +- .../org/openrewrite/java/JavadocVisitor.java | 2 +- .../org/openrewrite/java/MethodMatcher.java | 8 +-- .../org/openrewrite/java/NoMissingTypes.java | 2 +- .../org/openrewrite/java/OrderImports.java | 2 +- .../openrewrite/java/RandomizeIdVisitor.java | 2 +- .../java/RecipeMarkupDemonstration.java | 2 +- .../java/RemoveAnnotationVisitor.java | 8 +-- .../openrewrite/java/RemoveImplements.java | 2 +- .../org/openrewrite/java/RemoveImport.java | 2 +- .../org/openrewrite/java/RenameVariable.java | 2 +- .../java/ReorderMethodArguments.java | 2 +- .../openrewrite/java/ReplaceAnnotation.java | 2 +- .../org/openrewrite/java/ReplaceConstant.java | 7 ++- .../ReplaceConstantWithAnotherConstant.java | 4 +- .../ReplaceStringLiteralWithConstant.java | 2 +- .../ShortenFullyQualifiedTypeReferences.java | 4 +- .../openrewrite/java/SimplifyMethodChain.java | 2 +- .../openrewrite/java/TreeVisitingPrinter.java | 2 +- .../org/openrewrite/java/TypeMatcher.java | 2 +- .../java/UnsafeReplaceJavaType.java | 2 +- .../java/UpdateSourcePositions.java | 2 +- .../org/openrewrite/java/UseStaticImport.java | 4 +- .../openrewrite/java/VariableNameUtils.java | 4 +- .../org/openrewrite/java/ai/package-info.java | 4 +- .../SimplifyBooleanExpressionVisitor.java | 2 +- .../java/cleanup/package-info.java | 4 +- .../openrewrite/java/filter/package-info.java | 4 +- .../java/format/AutoFormatVisitor.java | 2 +- .../openrewrite/java/format/BlankLines.java | 2 +- .../java/format/BlankLinesVisitor.java | 2 +- .../java/format/EmptyNewlineAtEndOfFile.java | 2 +- .../java/format/MethodParamPad.java | 2 +- .../format/MinimumViableSpacingVisitor.java | 2 +- .../java/format/NoWhitespaceAfter.java | 2 +- .../java/format/NoWhitespaceBefore.java | 2 +- .../java/format/NormalizeFormatVisitor.java | 2 +- .../java/format/NormalizeLineBreaks.java | 2 +- .../format/NormalizeLineBreaksVisitor.java | 2 +- .../java/format/NormalizeTabsOrSpaces.java | 2 +- .../format/NormalizeTabsOrSpacesVisitor.java | 4 +- .../openrewrite/java/format/OperatorWrap.java | 2 +- .../format/PadEmptyForLoopComponents.java | 2 +- .../RemoveTrailingWhitespaceVisitor.java | 2 +- .../org/openrewrite/java/format/Spaces.java | 2 +- .../java/format/SpacesVisitor.java | 2 +- .../java/format/TabsAndIndents.java | 2 +- .../java/format/TabsAndIndentsVisitor.java | 2 +- .../java/format/TypecastParenPad.java | 2 +- .../java/format/WrappingAndBraces.java | 2 +- .../java/format/WrappingAndBracesVisitor.java | 2 +- .../openrewrite/java/format/package-info.java | 4 +- .../DefaultJavaTypeSignatureBuilder.java | 2 +- .../internal/JavaReflectionTypeMapping.java | 2 +- .../JavaReflectionTypeSignatureBuilder.java | 2 +- .../java/internal/JavaTypeCache.java | 2 +- .../openrewrite/java/internal/TypesInUse.java | 2 +- .../java/internal/package-info.java | 4 +- .../template/AnnotationTemplateGenerator.java | 2 +- .../BlockStatementTemplateGenerator.java | 7 ++- .../internal/template/PatternVariables.java | 2 +- .../java/internal/template/Substitutions.java | 2 +- .../internal/template/TemplateParameter.java | 2 +- .../java/internal/template/TypeParameter.java | 4 +- .../java/internal/template/package-info.java | 4 +- .../openrewrite/java/marker/JavaProject.java | 2 +- .../java/marker/JavaSourceSet.java | 2 +- .../openrewrite/java/marker/package-info.java | 4 +- .../org/openrewrite/java/package-info.java | 4 +- .../openrewrite/java/recipes/FindRecipes.java | 2 +- .../java/recipes/package-info.java | 4 +- .../java/search/DeclaresMethod.java | 2 +- .../java/search/FindAnnotations.java | 2 +- .../java/search/FindDeprecatedClasses.java | 2 +- .../java/search/FindDeprecatedFields.java | 2 +- .../java/search/FindDeprecatedMethods.java | 2 +- .../java/search/FindDeprecatedUses.java | 2 +- .../java/search/FindEmptyMethods.java | 2 +- .../openrewrite/java/search/FindFields.java | 2 +- .../java/search/FindFieldsOfType.java | 2 +- .../openrewrite/java/search/FindImports.java | 2 +- .../java/search/FindInheritedFields.java | 4 +- .../java/search/FindMethodDeclaration.java | 2 +- .../openrewrite/java/search/FindMethods.java | 2 +- .../search/FindRepeatableAnnotations.java | 2 +- .../java/search/FindTypeMappings.java | 2 +- .../openrewrite/java/search/FindTypes.java | 4 +- .../java/search/HasBuildToolVersion.java | 2 +- .../java/search/HasJavaVersion.java | 2 +- .../java/search/HasMinimumJavaVersion.java | 2 +- .../openrewrite/java/search/HasSourceSet.java | 2 +- .../search/HasTypeOnClasspathSourceSet.java | 2 +- .../java/search/InJavaSourceSet.java | 2 +- .../openrewrite/java/search/IsLikelyTest.java | 2 +- .../search/ResultOfMethodCallIgnored.java | 2 +- .../java/search/SemanticallyEqual.java | 2 +- .../java/search/UsesAllMethods.java | 2 +- .../openrewrite/java/search/UsesField.java | 2 +- .../java/search/UsesJavaVersion.java | 2 +- .../openrewrite/java/search/UsesMethod.java | 2 +- .../org/openrewrite/java/search/UsesType.java | 2 +- .../openrewrite/java/search/package-info.java | 4 +- .../java/service/AutoFormatService.java | 2 +- .../java/service/ImportService.java | 2 +- .../java/service/package-info.java | 4 +- .../openrewrite/java/style/Autodetect.java | 2 +- .../java/style/CheckstyleConfigLoader.java | 2 +- .../java/style/EmptyBlockStyle.java | 2 +- .../java/style/ImportLayoutStyle.java | 4 +- .../java/style/OperatorWrapStyle.java | 2 +- .../openrewrite/java/style/package-info.java | 4 +- .../java/table/ClassHierarchy.java | 2 +- .../openrewrite/java/table/package-info.java | 4 +- .../org/openrewrite/java/trait/Annotated.java | 2 +- .../org/openrewrite/java/trait/Literal.java | 2 +- .../openrewrite/java/trait/MethodAccess.java | 2 +- .../java/trait/VariableAccess.java | 2 +- .../java/trait/internal/package-info.java | 4 +- .../openrewrite/java/trait/package-info.java | 4 +- .../org/openrewrite/java/tree/Expression.java | 2 +- .../java/org/openrewrite/java/tree/Flag.java | 2 +- .../java/org/openrewrite/java/tree/J.java | 54 ++++++++----------- .../org/openrewrite/java/tree/JContainer.java | 2 +- .../openrewrite/java/tree/JLeftPadded.java | 2 +- .../openrewrite/java/tree/JRightPadded.java | 2 +- .../java/tree/JavaCoordinates.java | 2 +- .../openrewrite/java/tree/JavaSourceFile.java | 5 +- .../org/openrewrite/java/tree/JavaType.java | 4 +- .../org/openrewrite/java/tree/Javadoc.java | 2 +- .../org/openrewrite/java/tree/MethodCall.java | 7 ++- .../java/org/openrewrite/java/tree/Space.java | 2 +- .../org/openrewrite/java/tree/TypeTree.java | 2 +- .../org/openrewrite/java/tree/TypeUtils.java | 24 ++++----- .../org/openrewrite/java/tree/TypedTree.java | 2 +- .../openrewrite/java/tree/package-info.java | 4 +- .../java/OpenRewriteArchitectureTest.java | 4 +- .../template/PatternVariablesTest.java | 2 +- .../java/org/openrewrite/json/Assertions.java | 2 +- .../java/org/openrewrite/json/JsonParser.java | 2 +- .../org/openrewrite/json/JsonPathMatcher.java | 2 +- .../org/openrewrite/json/JsonVisitor.java | 2 +- .../json/internal/JsonParserVisitor.java | 2 +- .../json/internal/package-info.java | 4 +- .../openrewrite/json/marker/package-info.java | 4 +- .../org/openrewrite/json/package-info.java | 4 +- .../openrewrite/json/search/package-info.java | 4 +- .../java/org/openrewrite/json/tree/Json.java | 2 +- .../java/org/openrewrite/json/tree/Space.java | 2 +- .../openrewrite/json/tree/package-info.java | 4 +- .../org/openrewrite/maven/AddDependency.java | 2 +- .../maven/AddDependencyVisitor.java | 2 +- .../maven/AddDevelocityMavenExtension.java | 2 +- .../maven/AddManagedDependency.java | 2 +- .../maven/AddManagedDependencyVisitor.java | 2 +- .../org/openrewrite/maven/AddParentPom.java | 2 +- .../java/org/openrewrite/maven/AddPlugin.java | 2 +- .../maven/AddPluginDependency.java | 2 +- .../org/openrewrite/maven/AddProfile.java | 2 +- .../org/openrewrite/maven/AddProperty.java | 2 +- .../openrewrite/maven/AddPropertyVisitor.java | 2 +- .../org/openrewrite/maven/AddRepository.java | 2 +- .../openrewrite/maven/AddRuntimeConfig.java | 2 +- .../org/openrewrite/maven/Assertions.java | 2 +- .../maven/ChangeDependencyClassifier.java | 2 +- .../ChangeDependencyGroupIdAndArtifactId.java | 2 +- .../maven/ChangeDependencyScope.java | 2 +- ...ManagedDependencyGroupIdAndArtifactId.java | 2 +- .../openrewrite/maven/ChangePackaging.java | 2 +- .../openrewrite/maven/ChangeParentPom.java | 4 +- .../maven/ChangePluginConfiguration.java | 2 +- .../maven/ChangePluginDependencies.java | 2 +- .../maven/ChangePluginExecutions.java | 2 +- .../ChangePluginGroupIdAndArtifactId.java | 2 +- .../maven/ChangeProjectVersion.java | 2 +- .../maven/ChangePropertyValue.java | 2 +- .../openrewrite/maven/ExcludeDependency.java | 2 +- .../openrewrite/maven/ManageDependencies.java | 2 +- .../maven/MavenDownloadingException.java | 2 +- .../maven/MavenDownloadingExceptions.java | 2 +- .../maven/MavenExecutionContextView.java | 2 +- .../org/openrewrite/maven/MavenParser.java | 2 +- .../org/openrewrite/maven/MavenSettings.java | 2 +- .../org/openrewrite/maven/MavenVisitor.java | 6 +-- .../openrewrite/maven/RemoveDependency.java | 2 +- .../maven/RemoveDuplicateDependencies.java | 2 +- .../openrewrite/maven/RemoveExclusion.java | 2 +- .../maven/RemoveManagedDependency.java | 2 +- .../RemoveRedundantDependencyVersions.java | 2 +- .../openrewrite/maven/RemoveRepository.java | 2 +- .../openrewrite/maven/UpdateMavenModel.java | 2 +- .../openrewrite/maven/UpdateMavenWrapper.java | 2 +- .../maven/UpgradeDependencyVersion.java | 2 +- .../maven/UpgradeParentVersion.java | 2 +- .../maven/UpgradePluginVersion.java | 2 +- .../UpgradeTransitiveDependencyVersion.java | 2 +- .../maven/cache/CompositeMavenPomCache.java | 2 +- .../maven/cache/InMemoryMavenPomCache.java | 2 +- .../maven/cache/LocalMavenArtifactCache.java | 2 +- .../maven/cache/MavenArtifactCache.java | 2 +- .../maven/cache/MavenPomCache.java | 2 +- .../ReadOnlyLocalMavenArtifactCache.java | 2 +- .../maven/cache/RocksdbMavenPomCache.java | 2 +- .../maven/cleanup/package-info.java | 4 +- .../maven/internal/MavenPomDownloader.java | 8 +-- .../openrewrite/maven/internal/RawPom.java | 4 +- .../maven/internal/RawRepositories.java | 2 +- .../maven/internal/VersionRequirement.java | 2 +- .../maven/internal/package-info.java | 4 +- .../org/openrewrite/maven/package-info.java | 4 +- .../maven/search/DependencyInsight.java | 2 +- .../search/DoesNotIncludeDependency.java | 2 +- .../search/EffectiveMavenRepositories.java | 2 +- .../maven/search/FindDependency.java | 2 +- .../maven/search/FindManagedDependency.java | 2 +- .../maven/search/FindMavenSettings.java | 2 +- .../maven/search/FindProperties.java | 2 +- .../maven/search/ParentPomInsight.java | 2 +- .../maven/search/package-info.java | 4 +- .../maven/security/package-info.java | 4 +- .../maven/table/DependenciesInUse.java | 2 +- .../maven/table/MavenProperties.java | 2 +- .../maven/table/ParentPomsInUse.java | 2 +- .../maven/trait/MavenDependency.java | 2 +- .../openrewrite/maven/trait/MavenPlugin.java | 2 +- .../openrewrite/maven/trait/package-info.java | 4 +- .../openrewrite/maven/tree/Dependency.java | 2 +- .../tree/GraphvizResolutionEventListener.java | 2 +- .../maven/tree/GroupArtifactVersion.java | 2 +- .../org/openrewrite/maven/tree/License.java | 2 +- .../maven/tree/ManagedDependency.java | 2 +- .../openrewrite/maven/tree/MavenMetadata.java | 2 +- .../maven/tree/MavenRepository.java | 2 +- .../maven/tree/MavenRepositoryMirror.java | 4 +- .../maven/tree/MavenResolutionResult.java | 2 +- .../org/openrewrite/maven/tree/Parent.java | 2 +- .../org/openrewrite/maven/tree/Plugin.java | 2 +- .../java/org/openrewrite/maven/tree/Pom.java | 2 +- .../org/openrewrite/maven/tree/Profile.java | 2 +- .../maven/tree/ProfileActivation.java | 2 +- .../maven/tree/ResolutionEventListener.java | 2 +- .../maven/tree/ResolvedDependency.java | 2 +- .../tree/ResolvedGroupArtifactVersion.java | 2 +- .../maven/tree/ResolvedManagedDependency.java | 2 +- .../openrewrite/maven/tree/ResolvedPom.java | 2 +- .../org/openrewrite/maven/tree/Scope.java | 2 +- .../org/openrewrite/maven/tree/Version.java | 4 +- .../openrewrite/maven/tree/package-info.java | 4 +- .../utilities/MavenArtifactDownloader.java | 2 +- .../maven/utilities/MavenWrapper.java | 2 +- .../maven/utilities/package-info.java | 4 +- .../openrewrite/maven/AddDependencyTest.java | 2 +- .../org/openrewrite/maven/AssertionsTest.java | 2 +- .../maven/UpdateMavenWrapperTest.java | 2 +- .../internal/MavenPomDownloaderTest.java | 2 +- .../maven/internal/package-info.java | 4 +- .../org/openrewrite/maven/package-info.java | 4 +- .../openrewrite/properties/AddProperty.java | 2 +- .../openrewrite/properties/Assertions.java | 2 +- .../properties/ChangePropertyKey.java | 2 +- .../properties/ChangePropertyValue.java | 4 +- .../properties/CreatePropertiesFile.java | 2 +- .../properties/DeleteProperty.java | 2 +- .../properties/PropertiesParser.java | 4 +- .../properties/PropertiesVisitor.java | 4 +- .../properties/internal/package-info.java | 4 +- .../openrewrite/properties/package-info.java | 4 +- .../properties/search/FindProperties.java | 2 +- .../properties/search/package-info.java | 4 +- .../properties/tree/Properties.java | 2 +- .../properties/tree/package-info.java | 4 +- .../org/openrewrite/protobuf/Assertions.java | 2 +- .../org/openrewrite/protobuf/ProtoParser.java | 2 +- .../openrewrite/protobuf/ProtoVisitor.java | 2 +- .../protobuf/internal/ProtoParserVisitor.java | 4 +- .../protobuf/internal/ProtoPrinter.java | 2 +- .../protobuf/internal/package-info.java | 4 +- .../openrewrite/protobuf/package-info.java | 4 +- .../org/openrewrite/protobuf/tree/Proto.java | 2 +- .../protobuf/tree/ProtoContainer.java | 2 +- .../protobuf/tree/ProtoLeftPadded.java | 2 +- .../org/openrewrite/protobuf/tree/Space.java | 2 +- .../protobuf/tree/package-info.java | 4 +- .../org/openrewrite/test/AdHocRecipe.java | 2 +- .../openrewrite/test/AdHocScanningRecipe.java | 2 +- .../LargeSourceSetCheckingExpectedCycles.java | 2 +- .../java/org/openrewrite/test/RecipeSpec.java | 5 +- .../org/openrewrite/test/RewriteTest.java | 4 +- .../java/org/openrewrite/test/SourceSpec.java | 2 +- .../org/openrewrite/test/SourceSpecs.java | 2 +- .../org/openrewrite/test/package-info.java | 4 +- .../test/internal/RewriteTestTest.java | 10 ++-- .../org/openrewrite/xml/AddToTagVisitor.java | 2 +- .../java/org/openrewrite/xml/Assertions.java | 2 +- .../openrewrite/xml/ChangeNamespaceValue.java | 2 +- .../openrewrite/xml/ChangeTagAttribute.java | 2 +- .../org/openrewrite/xml/ChangeTagValue.java | 2 +- .../org/openrewrite/xml/CreateXmlFile.java | 2 +- .../org/openrewrite/xml/RemoveXmlTag.java | 2 +- .../openrewrite/xml/SemanticallyEqual.java | 2 +- .../org/openrewrite/xml/XPathMatcher.java | 2 +- .../java/org/openrewrite/xml/XmlParser.java | 2 +- .../java/org/openrewrite/xml/XmlVisitor.java | 2 +- .../openrewrite/xml/XsltTransformation.java | 2 +- .../xml/format/AutoFormatVisitor.java | 2 +- .../format/AutodetectGeneralFormatStyle.java | 2 +- .../xml/format/LineBreaksVisitor.java | 2 +- .../format/MinimumViableSpacingVisitor.java | 2 +- .../xml/format/NormalizeFormatVisitor.java | 2 +- .../format/NormalizeLineBreaksVisitor.java | 2 +- .../format/NormalizeTabsOrSpacesVisitor.java | 4 +- .../RemoveTrailingWhitespaceVisitor.java | 2 +- .../xml/format/TabsAndIndentsVisitor.java | 2 +- .../openrewrite/xml/format/package-info.java | 4 +- .../xml/internal/XmlParserVisitor.java | 2 +- .../xml/internal/package-info.java | 4 +- .../org/openrewrite/xml/package-info.java | 4 +- .../xml/search/FindNamespacePrefix.java | 2 +- .../org/openrewrite/xml/search/FindTags.java | 4 +- .../xml/search/HasNamespaceUri.java | 2 +- .../openrewrite/xml/search/package-info.java | 4 +- .../AddOwaspDateBoundSuppressions.java | 2 +- .../security/UpdateOwaspSuppressionDate.java | 2 +- .../xml/security/package-info.java | 4 +- .../org/openrewrite/xml/style/Autodetect.java | 2 +- .../xml/style/AutodetectDebug.java | 2 +- .../openrewrite/xml/style/package-info.java | 4 +- .../org/openrewrite/xml/trait/Namespaced.java | 2 +- .../openrewrite/xml/trait/package-info.java | 4 +- .../java/org/openrewrite/xml/tree/Xml.java | 2 +- .../openrewrite/xml/tree/package-info.java | 4 +- .../openrewrite/yaml/AppendToSequence.java | 2 +- .../yaml/AppendToSequenceVisitor.java | 2 +- .../java/org/openrewrite/yaml/Assertions.java | 2 +- .../openrewrite/yaml/ChangePropertyKey.java | 2 +- .../openrewrite/yaml/ChangePropertyValue.java | 4 +- .../org/openrewrite/yaml/ChangeValue.java | 2 +- .../java/org/openrewrite/yaml/CopyValue.java | 2 +- .../org/openrewrite/yaml/CreateYamlFile.java | 2 +- .../java/org/openrewrite/yaml/DeleteKey.java | 2 +- .../org/openrewrite/yaml/DeleteProperty.java | 2 +- .../org/openrewrite/yaml/JsonPathMatcher.java | 2 +- .../java/org/openrewrite/yaml/MergeYaml.java | 2 +- .../openrewrite/yaml/MergeYamlVisitor.java | 2 +- .../java/org/openrewrite/yaml/YamlParser.java | 14 ++--- .../org/openrewrite/yaml/YamlVisitor.java | 2 +- .../yaml/cleanup/RemoveUnusedVisitor.java | 2 +- .../yaml/cleanup/package-info.java | 4 +- .../yaml/format/AutoFormatVisitor.java | 2 +- .../yaml/format/IndentsVisitor.java | 2 +- .../format/MinimumViableSpacingVisitor.java | 2 +- .../yaml/format/NormalizeFormatVisitor.java | 2 +- .../format/NormalizeLineBreaksVisitor.java | 2 +- .../openrewrite/yaml/format/package-info.java | 4 +- .../yaml/internal/package-info.java | 4 +- .../org/openrewrite/yaml/package-info.java | 4 +- .../openrewrite/yaml/search/FindProperty.java | 2 +- .../openrewrite/yaml/search/package-info.java | 4 +- .../openrewrite/yaml/style/Autodetect.java | 2 +- .../openrewrite/yaml/style/package-info.java | 4 +- .../java/org/openrewrite/yaml/tree/Yaml.java | 2 +- .../openrewrite/yaml/tree/package-info.java | 4 +- .../openrewrite/yaml/CreateYamlFileTest.java | 2 +- 680 files changed, 953 insertions(+), 958 deletions(-) diff --git a/rewrite-benchmarks/src/jmh/java/org/openrewrite/benchmarks/java/package-info.java b/rewrite-benchmarks/src/jmh/java/org/openrewrite/benchmarks/java/package-info.java index a32da1c720c..cc6e3eaeaaa 100644 --- a/rewrite-benchmarks/src/jmh/java/org/openrewrite/benchmarks/java/package-info.java +++ b/rewrite-benchmarks/src/jmh/java/org/openrewrite/benchmarks/java/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.benchmarks.java; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/Checksum.java b/rewrite-core/src/main/java/org/openrewrite/Checksum.java index 9a65325790e..018ecbf0424 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Checksum.java +++ b/rewrite-core/src/main/java/org/openrewrite/Checksum.java @@ -16,7 +16,7 @@ package org.openrewrite; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.remote.Remote; diff --git a/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java b/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java index 96a3dd48773..8a295913529 100644 --- a/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java +++ b/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import java.nio.file.Path; import java.util.concurrent.atomic.AtomicBoolean; diff --git a/rewrite-core/src/main/java/org/openrewrite/Cursor.java b/rewrite-core/src/main/java/org/openrewrite/Cursor.java index 6dbfb6bec7c..969872bc044 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Cursor.java +++ b/rewrite-core/src/main/java/org/openrewrite/Cursor.java @@ -16,7 +16,7 @@ package org.openrewrite; import lombok.EqualsAndHashCode; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.*; import java.util.function.Function; diff --git a/rewrite-core/src/main/java/org/openrewrite/DelegatingExecutionContext.java b/rewrite-core/src/main/java/org/openrewrite/DelegatingExecutionContext.java index 9eaa566c7c5..920471daa91 100644 --- a/rewrite-core/src/main/java/org/openrewrite/DelegatingExecutionContext.java +++ b/rewrite-core/src/main/java/org/openrewrite/DelegatingExecutionContext.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.function.BiConsumer; import java.util.function.Consumer; diff --git a/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java b/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java index a836522ef6e..59d59824d7c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java +++ b/rewrite-core/src/main/java/org/openrewrite/DeleteSourceFiles.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.nio.file.Path; import java.nio.file.PathMatcher; diff --git a/rewrite-core/src/main/java/org/openrewrite/ExecutionContext.java b/rewrite-core/src/main/java/org/openrewrite/ExecutionContext.java index c3823e4acb1..1b0f3b83a45 100644 --- a/rewrite-core/src/main/java/org/openrewrite/ExecutionContext.java +++ b/rewrite-core/src/main/java/org/openrewrite/ExecutionContext.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.scheduling.RecipeRunCycle; import java.util.*; diff --git a/rewrite-core/src/main/java/org/openrewrite/FileAttributes.java b/rewrite-core/src/main/java/org/openrewrite/FileAttributes.java index cfa5fd09de8..a0a14fad7f3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FileAttributes.java +++ b/rewrite-core/src/main/java/org/openrewrite/FileAttributes.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.IOException; import java.nio.file.Files; diff --git a/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java b/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java index f3ddc3b942e..f260d4e9269 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindCollidingSourceFiles.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.table.CollidingSourceFiles; diff --git a/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java b/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java index e3c57e5d8ca..32c54c31291 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindGitProvenance.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.GitProvenance; import org.openrewrite.table.DistinctGitProvenance; diff --git a/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java b/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java index 99b1e32b879..baa55b12848 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindParseFailures.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markup; import org.openrewrite.table.ParseFailures; diff --git a/rewrite-core/src/main/java/org/openrewrite/FindQuarks.java b/rewrite-core/src/main/java/org/openrewrite/FindQuarks.java index 7fab1021ca0..1987f3ba18c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindQuarks.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindQuarks.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.quark.Quark; diff --git a/rewrite-core/src/main/java/org/openrewrite/FindSourceFiles.java b/rewrite-core/src/main/java/org/openrewrite/FindSourceFiles.java index 74faa8e09f8..bf0aa62a234 100644 --- a/rewrite-core/src/main/java/org/openrewrite/FindSourceFiles.java +++ b/rewrite-core/src/main/java/org/openrewrite/FindSourceFiles.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.table.SourcesFiles; diff --git a/rewrite-core/src/main/java/org/openrewrite/GitRemote.java b/rewrite-core/src/main/java/org/openrewrite/GitRemote.java index 2f9be6eff47..2b7d1d8ff0e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/GitRemote.java +++ b/rewrite-core/src/main/java/org/openrewrite/GitRemote.java @@ -16,7 +16,7 @@ package org.openrewrite; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.jgit.transport.URIish; import java.net.URISyntaxException; diff --git a/rewrite-core/src/main/java/org/openrewrite/InMemoryExecutionContext.java b/rewrite-core/src/main/java/org/openrewrite/InMemoryExecutionContext.java index edf5a76d60c..e3de51bc336 100644 --- a/rewrite-core/src/main/java/org/openrewrite/InMemoryExecutionContext.java +++ b/rewrite-core/src/main/java/org/openrewrite/InMemoryExecutionContext.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.time.Duration; import java.util.Map; diff --git a/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java b/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java index 0fcb6987a60..ef53d01aa8e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java +++ b/rewrite-core/src/main/java/org/openrewrite/IsInRepository.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.GitProvenance; import org.openrewrite.marker.SearchResult; diff --git a/rewrite-core/src/main/java/org/openrewrite/LargeSourceSet.java b/rewrite-core/src/main/java/org/openrewrite/LargeSourceSet.java index 1eb55114736..9e6d2c6f4e6 100644 --- a/rewrite-core/src/main/java/org/openrewrite/LargeSourceSet.java +++ b/rewrite-core/src/main/java/org/openrewrite/LargeSourceSet.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.nio.file.Path; import java.util.Collection; diff --git a/rewrite-core/src/main/java/org/openrewrite/Maintainer.java b/rewrite-core/src/main/java/org/openrewrite/Maintainer.java index 16bde5bb72d..61cb9ba139e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Maintainer.java +++ b/rewrite-core/src/main/java/org/openrewrite/Maintainer.java @@ -16,7 +16,7 @@ package org.openrewrite; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.net.URI; diff --git a/rewrite-core/src/main/java/org/openrewrite/ParseExceptionResult.java b/rewrite-core/src/main/java/org/openrewrite/ParseExceptionResult.java index e02e8b214de..653b7e15e49 100644 --- a/rewrite-core/src/main/java/org/openrewrite/ParseExceptionResult.java +++ b/rewrite-core/src/main/java/org/openrewrite/ParseExceptionResult.java @@ -17,9 +17,9 @@ import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ExceptionUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/Parser.java b/rewrite-core/src/main/java/org/openrewrite/Parser.java index aba8820d897..fd308a2d86d 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Parser.java +++ b/rewrite-core/src/main/java/org/openrewrite/Parser.java @@ -17,9 +17,9 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.tree.ParseError; import org.openrewrite.tree.ParsingExecutionContextView; diff --git a/rewrite-core/src/main/java/org/openrewrite/PathUtils.java b/rewrite-core/src/main/java/org/openrewrite/PathUtils.java index 4567f71b9eb..528bcc7e479 100755 --- a/rewrite-core/src/main/java/org/openrewrite/PathUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/PathUtils.java @@ -15,8 +15,8 @@ */ package org.openrewrite; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.io.File; import java.nio.file.Path; diff --git a/rewrite-core/src/main/java/org/openrewrite/Preconditions.java b/rewrite-core/src/main/java/org/openrewrite/Preconditions.java index 825f46886ff..cd7e0565a78 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Preconditions.java +++ b/rewrite-core/src/main/java/org/openrewrite/Preconditions.java @@ -16,7 +16,7 @@ package org.openrewrite; import lombok.Getter; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.SearchResult; import java.util.function.Supplier; diff --git a/rewrite-core/src/main/java/org/openrewrite/PrintOutputCapture.java b/rewrite-core/src/main/java/org/openrewrite/PrintOutputCapture.java index 211fcf3fe19..fc69045e4e1 100644 --- a/rewrite-core/src/main/java/org/openrewrite/PrintOutputCapture.java +++ b/rewrite-core/src/main/java/org/openrewrite/PrintOutputCapture.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Marker; import java.util.function.UnaryOperator; diff --git a/rewrite-core/src/main/java/org/openrewrite/Recipe.java b/rewrite-core/src/main/java/org/openrewrite/Recipe.java index 19832599c33..f9cd6e6649e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Recipe.java +++ b/rewrite-core/src/main/java/org/openrewrite/Recipe.java @@ -23,6 +23,7 @@ import lombok.Setter; import lombok.experimental.FieldDefaults; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.config.DataTableDescriptor; import org.openrewrite.config.OptionDescriptor; import org.openrewrite.config.RecipeDescriptor; @@ -30,7 +31,6 @@ import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; import org.openrewrite.internal.lang.NullUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.table.RecipeRunStats; import org.openrewrite.table.SourcesFileErrors; import org.openrewrite.table.SourcesFileResults; diff --git a/rewrite-core/src/main/java/org/openrewrite/RecipeRun.java b/rewrite-core/src/main/java/org/openrewrite/RecipeRun.java index 675a925fcc8..1149c2bf606 100644 --- a/rewrite-core/src/main/java/org/openrewrite/RecipeRun.java +++ b/rewrite-core/src/main/java/org/openrewrite/RecipeRun.java @@ -17,9 +17,9 @@ import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.config.ColumnDescriptor; import org.openrewrite.config.DataTableDescriptor; -import org.openrewrite.internal.lang.Nullable; import java.io.*; import java.lang.reflect.Field; diff --git a/rewrite-core/src/main/java/org/openrewrite/RenameFile.java b/rewrite-core/src/main/java/org/openrewrite/RenameFile.java index 4669895faed..df005a18c28 100644 --- a/rewrite-core/src/main/java/org/openrewrite/RenameFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/RenameFile.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.nio.file.Path; import java.nio.file.PathMatcher; diff --git a/rewrite-core/src/main/java/org/openrewrite/Repeat.java b/rewrite-core/src/main/java/org/openrewrite/Repeat.java index 49f4ea57faf..2a45e526e85 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Repeat.java +++ b/rewrite-core/src/main/java/org/openrewrite/Repeat.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; public class Repeat { diff --git a/rewrite-core/src/main/java/org/openrewrite/Result.java b/rewrite-core/src/main/java/org/openrewrite/Result.java index 319b0c782c5..ecd0b458807 100755 --- a/rewrite-core/src/main/java/org/openrewrite/Result.java +++ b/rewrite-core/src/main/java/org/openrewrite/Result.java @@ -16,9 +16,9 @@ package org.openrewrite; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.config.RecipeDescriptor; import org.openrewrite.internal.InMemoryDiffEntry; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.jgit.lib.FileMode; import org.openrewrite.marker.RecipesThatMadeChanges; import org.openrewrite.marker.SearchResult; @@ -188,12 +188,12 @@ public String diff(@Nullable Path relativeTo) { return diff(relativeTo, null); } - public String diff(@Nullable Path relativeTo, @Nullable PrintOutputCapture.MarkerPrinter markerPrinter) { + public String diff(@Nullable Path relativeTo, PrintOutputCapture.@Nullable MarkerPrinter markerPrinter) { return diff(relativeTo, markerPrinter, false); } @Incubating(since = "7.34.0") - public String diff(@Nullable Path relativeTo, @Nullable PrintOutputCapture.MarkerPrinter markerPrinter, @Nullable Boolean ignoreAllWhitespace) { + public String diff(@Nullable Path relativeTo, PrintOutputCapture.@Nullable MarkerPrinter markerPrinter, @Nullable Boolean ignoreAllWhitespace) { Path beforePath = before == null ? null : before.getSourcePath(); Path afterPath = null; if (before == null && after == null) { diff --git a/rewrite-core/src/main/java/org/openrewrite/ScanningRecipe.java b/rewrite-core/src/main/java/org/openrewrite/ScanningRecipe.java index c9e8ac9a6d8..a5aaa2f0a3e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/ScanningRecipe.java +++ b/rewrite-core/src/main/java/org/openrewrite/ScanningRecipe.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.Collection; import java.util.Collections; diff --git a/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java b/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java index 3a45862dd66..9cc17ba4444 100644 --- a/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java +++ b/rewrite-core/src/main/java/org/openrewrite/SetFilePermissions.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.nio.file.Path; import java.nio.file.PathMatcher; diff --git a/rewrite-core/src/main/java/org/openrewrite/SourceFile.java b/rewrite-core/src/main/java/org/openrewrite/SourceFile.java index f367b58db6f..988bdb35976 100644 --- a/rewrite-core/src/main/java/org/openrewrite/SourceFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/SourceFile.java @@ -15,8 +15,8 @@ */ package org.openrewrite; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.NamedStyles; import org.openrewrite.style.Style; diff --git a/rewrite-core/src/main/java/org/openrewrite/Tree.java b/rewrite-core/src/main/java/org/openrewrite/Tree.java index 80843ab6979..a709e99b528 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Tree.java +++ b/rewrite-core/src/main/java/org/openrewrite/Tree.java @@ -19,8 +19,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/TreeObserver.java b/rewrite-core/src/main/java/org/openrewrite/TreeObserver.java index 9dc846c4426..6929e3cb0f3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/TreeObserver.java +++ b/rewrite-core/src/main/java/org/openrewrite/TreeObserver.java @@ -20,7 +20,7 @@ import de.danielbechler.diff.inclusion.Inclusion; import de.danielbechler.diff.inclusion.InclusionResolver; import de.danielbechler.diff.node.DiffNode; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.beans.Transient; import java.util.ArrayList; diff --git a/rewrite-core/src/main/java/org/openrewrite/TreeVisitor.java b/rewrite-core/src/main/java/org/openrewrite/TreeVisitor.java index 5618f45993a..93ab54f16bb 100644 --- a/rewrite-core/src/main/java/org/openrewrite/TreeVisitor.java +++ b/rewrite-core/src/main/java/org/openrewrite/TreeVisitor.java @@ -18,10 +18,10 @@ import io.micrometer.core.instrument.DistributionSummary; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.RecipeRunException; import org.openrewrite.internal.TreeVisitorAdapter; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Markers; diff --git a/rewrite-core/src/main/java/org/openrewrite/Validated.java b/rewrite-core/src/main/java/org/openrewrite/Validated.java index 15394b13b19..19e3f48bbb0 100644 --- a/rewrite-core/src/main/java/org/openrewrite/Validated.java +++ b/rewrite-core/src/main/java/org/openrewrite/Validated.java @@ -15,8 +15,8 @@ */ package org.openrewrite; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.*; import java.util.function.Predicate; diff --git a/rewrite-core/src/main/java/org/openrewrite/ValidationException.java b/rewrite-core/src/main/java/org/openrewrite/ValidationException.java index fabe946d9d1..027826d5a45 100644 --- a/rewrite-core/src/main/java/org/openrewrite/ValidationException.java +++ b/rewrite-core/src/main/java/org/openrewrite/ValidationException.java @@ -15,7 +15,7 @@ */ package org.openrewrite; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.net.URI; import java.util.stream.Collectors; diff --git a/rewrite-core/src/main/java/org/openrewrite/ai/CodeEditResponse.java b/rewrite-core/src/main/java/org/openrewrite/ai/CodeEditResponse.java index 83dc287cde2..d366c5daed3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/ai/CodeEditResponse.java +++ b/rewrite-core/src/main/java/org/openrewrite/ai/CodeEditResponse.java @@ -16,7 +16,7 @@ package org.openrewrite.ai; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/rewrite-core/src/main/java/org/openrewrite/binary/Binary.java b/rewrite-core/src/main/java/org/openrewrite/binary/Binary.java index 35ac979a1b5..a9ce138b86b 100755 --- a/rewrite-core/src/main/java/org/openrewrite/binary/Binary.java +++ b/rewrite-core/src/main/java/org/openrewrite/binary/Binary.java @@ -17,8 +17,8 @@ import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.nio.charset.Charset; diff --git a/rewrite-core/src/main/java/org/openrewrite/binary/BinaryParser.java b/rewrite-core/src/main/java/org/openrewrite/binary/BinaryParser.java index ffb35554698..812cbf36c47 100755 --- a/rewrite-core/src/main/java/org/openrewrite/binary/BinaryParser.java +++ b/rewrite-core/src/main/java/org/openrewrite/binary/BinaryParser.java @@ -15,10 +15,10 @@ */ package org.openrewrite.binary; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.tree.ParseError; diff --git a/rewrite-core/src/main/java/org/openrewrite/binary/package-info.java b/rewrite-core/src/main/java/org/openrewrite/binary/package-info.java index 819bd4db025..80f6d5c09df 100755 --- a/rewrite-core/src/main/java/org/openrewrite/binary/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/binary/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.binary; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/CategoryTree.java b/rewrite-core/src/main/java/org/openrewrite/config/CategoryTree.java index d8e0aa7c5e9..ff0f6e8cdd5 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/CategoryTree.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/CategoryTree.java @@ -16,8 +16,8 @@ package org.openrewrite.config; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.*; import java.util.concurrent.CopyOnWriteArrayList; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java b/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java index c92080e538f..3897d671a12 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/ClasspathScanningLoader.java @@ -20,12 +20,12 @@ import io.github.classgraph.ScanResult; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; +import org.jspecify.annotations.Nullable; import org.openrewrite.Contributor; import org.openrewrite.Recipe; import org.openrewrite.ScanningRecipe; import org.openrewrite.internal.MetricsHelper; import org.openrewrite.internal.RecipeIntrospectionUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.NamedStyles; import java.lang.reflect.Constructor; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/ColumnDescriptor.java b/rewrite-core/src/main/java/org/openrewrite/config/ColumnDescriptor.java index 351de35ec9c..5493c68f627 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/ColumnDescriptor.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/ColumnDescriptor.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.NlsRewrite; -import org.openrewrite.internal.lang.Nullable; @Value @EqualsAndHashCode(onlyExplicitlyIncluded = true) diff --git a/rewrite-core/src/main/java/org/openrewrite/config/DeclarativeRecipe.java b/rewrite-core/src/main/java/org/openrewrite/config/DeclarativeRecipe.java index e7c1e2b7a3c..150575a3217 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/DeclarativeRecipe.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/DeclarativeRecipe.java @@ -19,8 +19,8 @@ import lombok.*; import lombok.experimental.NonFinal; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import java.net.URI; import java.time.Duration; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/OptionDescriptor.java b/rewrite-core/src/main/java/org/openrewrite/config/OptionDescriptor.java index d010831f286..721f2349d66 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/OptionDescriptor.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/OptionDescriptor.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.NlsRewrite; -import org.openrewrite.internal.lang.Nullable; import java.util.List; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/RecipeDescriptor.java b/rewrite-core/src/main/java/org/openrewrite/config/RecipeDescriptor.java index 07a9d731ffe..5365e2d6e92 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/RecipeDescriptor.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/RecipeDescriptor.java @@ -18,10 +18,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.Contributor; import org.openrewrite.Maintainer; import org.openrewrite.NlsRewrite; -import org.openrewrite.internal.lang.Nullable; import java.net.URI; import java.time.Duration; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/RecipeExample.java b/rewrite-core/src/main/java/org/openrewrite/config/RecipeExample.java index 9c96f605d28..71383042010 100755 --- a/rewrite-core/src/main/java/org/openrewrite/config/RecipeExample.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/RecipeExample.java @@ -19,7 +19,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/YamlResourceLoader.java b/rewrite-core/src/main/java/org/openrewrite/config/YamlResourceLoader.java index 86f4cf42ea1..7d1f24d8ad1 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/YamlResourceLoader.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/YamlResourceLoader.java @@ -25,9 +25,9 @@ import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; import lombok.Getter; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.NamedStyles; import org.openrewrite.style.Style; import org.yaml.snakeyaml.LoaderOptions; diff --git a/rewrite-core/src/main/java/org/openrewrite/config/package-info.java b/rewrite-core/src/main/java/org/openrewrite/config/package-info.java index dd22eeae0c1..901518e2eab 100644 --- a/rewrite-core/src/main/java/org/openrewrite/config/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/config/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.config; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/EncodingDetectingInputStream.java b/rewrite-core/src/main/java/org/openrewrite/internal/EncodingDetectingInputStream.java index 535db6b724c..1dae79b4763 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/EncodingDetectingInputStream.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/EncodingDetectingInputStream.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryDiffEntry.java b/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryDiffEntry.java index 5ca32360125..7e438070009 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryDiffEntry.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryDiffEntry.java @@ -15,8 +15,8 @@ */ package org.openrewrite.internal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.jgit.diff.DiffEntry; import org.openrewrite.jgit.diff.DiffFormatter; import org.openrewrite.jgit.diff.RawTextComparator; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryLargeSourceSet.java b/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryLargeSourceSet.java index 1e3d53db3a9..1d8fb5828bb 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryLargeSourceSet.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/InMemoryLargeSourceSet.java @@ -16,8 +16,8 @@ package org.openrewrite.internal; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Generated; import org.openrewrite.marker.RecipesThatMadeChanges; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/ListUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/ListUtils.java index e8a47c4d6b6..c230a855fb1 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/ListUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/ListUtils.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.ArrayList; import java.util.Comparator; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/LoggingMeterRegistry.java b/rewrite-core/src/main/java/org/openrewrite/internal/LoggingMeterRegistry.java index 33028671883..adf80704db9 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/LoggingMeterRegistry.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/LoggingMeterRegistry.java @@ -29,7 +29,7 @@ import io.micrometer.core.instrument.internal.DefaultLongTaskTimer; import io.micrometer.core.instrument.util.TimeUtils; import io.micrometer.core.lang.Nullable; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import java.time.Duration; import java.util.concurrent.TimeUnit; @@ -42,7 +42,7 @@ import static io.micrometer.core.instrument.util.DoubleFormat.decimalOrNan; import static java.util.stream.Collectors.joining; -@NonNullApi +@NullMarked public class LoggingMeterRegistry extends MeterRegistry { private final long startInterval; private final TimeUnit baseTimeUnit; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/PropertyPlaceholderHelper.java b/rewrite-core/src/main/java/org/openrewrite/internal/PropertyPlaceholderHelper.java index 3c6ebdd1132..2bbb3e913c8 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/PropertyPlaceholderHelper.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/PropertyPlaceholderHelper.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.*; import java.util.function.Function; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java index f7b5e5023fc..cc543aad6dc 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java @@ -15,12 +15,12 @@ */ package org.openrewrite.internal; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.config.ColumnDescriptor; import org.openrewrite.config.DataTableDescriptor; import org.openrewrite.config.RecipeIntrospectionException; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/RecipeRunException.java b/rewrite-core/src/main/java/org/openrewrite/internal/RecipeRunException.java index 5622ef2be37..3b61b3cacc8 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/RecipeRunException.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/RecipeRunException.java @@ -16,8 +16,8 @@ package org.openrewrite.internal; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; -import org.openrewrite.internal.lang.Nullable; /** * This provides a way for us to capture the cursor position where an unexpected exception was thrown so that diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/ReflectionUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/ReflectionUtils.java index 8056e60ff88..8cda946a88d 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/ReflectionUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/ReflectionUtils.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.lang.reflect.Method; import java.lang.reflect.Modifier; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java index 87a12fe09da..bdeaaa07585 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java @@ -15,8 +15,8 @@ */ package org.openrewrite.internal; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import java.io.ByteArrayOutputStream; import java.io.File; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNull.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNull.java index c26ec98b119..ab50786e9e7 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNull.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNull.java @@ -15,6 +15,9 @@ */ package org.openrewrite.internal.lang; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; + import javax.annotation.Nonnull; import javax.annotation.meta.TypeQualifierNickname; import java.lang.annotation.*; @@ -29,7 +32,7 @@ * (scope = fields) to set the default behavior to non-nullable in order to avoid annotating * your whole codebase with {@code @NonNull}. * - * @see NonNullApi + * @see NullMarked * @see NonNullFields * @see Nullable * @deprecated Use {@link org.jspecify.annotations.NonNull} instead. diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java index 56f0a261f77..b56521a5c13 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java @@ -15,7 +15,9 @@ */ package org.openrewrite.internal.lang; +import org.jspecify.annotations.NonNull; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; import javax.annotation.meta.TypeQualifierDefault; import java.lang.annotation.*; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullFields.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullFields.java index 6e96ffd049f..96cb6c2f9f3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullFields.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullFields.java @@ -15,6 +15,8 @@ */ package org.openrewrite.internal.lang; +import org.jspecify.annotations.Nullable; + import javax.annotation.meta.TypeQualifierDefault; import java.lang.annotation.*; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java index e2cc56aa845..8f6f8cfed9e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java @@ -15,6 +15,7 @@ */ package org.openrewrite.internal.lang; +import org.jspecify.annotations.NonNull; import org.openrewrite.Option; import java.lang.annotation.Annotation; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java index 7cdc0ec1c97..2316168449a 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java @@ -15,6 +15,9 @@ */ package org.openrewrite.internal.lang; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.NullMarked; + import javax.annotation.meta.TypeQualifierNickname; import java.lang.annotation.*; @@ -27,7 +30,7 @@ *

Can be used in association with {@code NonNullApi} or {@code @NonNullFields} to * override the default non-nullable semantic to nullable. * - * @see NonNullApi + * @see NullMarked * @see NonNullFields * @see NonNull * @deprecated Use {@link org.jspecify.annotations.Nullable} instead. diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/package-info.java b/rewrite-core/src/main/java/org/openrewrite/internal/package-info.java index a2a4159a243..c9db01c5554 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/AlreadyReplaced.java b/rewrite-core/src/main/java/org/openrewrite/marker/AlreadyReplaced.java index 3e44667700b..6c00f7b9a4c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/AlreadyReplaced.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/AlreadyReplaced.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/BuildToolFailure.java b/rewrite-core/src/main/java/org/openrewrite/marker/BuildToolFailure.java index 058e6cdda16..aa4f8c7c20c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/BuildToolFailure.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/BuildToolFailure.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/CommitMessage.java b/rewrite-core/src/main/java/org/openrewrite/marker/CommitMessage.java index 86ff2690e42..5b1c904ed9a 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/CommitMessage.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/CommitMessage.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.Recipe; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/GitProvenance.java b/rewrite-core/src/main/java/org/openrewrite/marker/GitProvenance.java index 9565a1e9904..a6775ddab74 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/GitProvenance.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/GitProvenance.java @@ -22,9 +22,9 @@ import lombok.Value; import lombok.With; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.GitRemote; import org.openrewrite.Incubating; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.jgit.api.Git; import org.openrewrite.jgit.api.errors.GitAPIException; import org.openrewrite.jgit.lib.*; @@ -187,7 +187,7 @@ public GitProvenance(UUID id, */ public static @Nullable GitProvenance fromProjectDirectory(Path projectDir, @Nullable BuildEnvironment environment, - @Nullable GitRemote.Parser gitRemoteParser) { + GitRemote.@Nullable Parser gitRemoteParser) { if (gitRemoteParser == null) { gitRemoteParser = new GitRemote.Parser(); } diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/LstProvenance.java b/rewrite-core/src/main/java/org/openrewrite/marker/LstProvenance.java index 9e020e3edcd..7a9080bf609 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/LstProvenance.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/LstProvenance.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.time.Instant; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/Markup.java b/rewrite-core/src/main/java/org/openrewrite/marker/Markup.java index 2c3f8f002a7..e641551ca8e 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/Markup.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/Markup.java @@ -19,13 +19,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Incubating; import org.openrewrite.RecipeScheduler; import org.openrewrite.Tree; import org.openrewrite.internal.ExceptionUtils; import org.openrewrite.internal.RecipeRunException; -import org.openrewrite.internal.lang.Nullable; import java.util.UUID; import java.util.function.UnaryOperator; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java b/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java index 1dd205b9e30..ac5c3cad193 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java @@ -22,9 +22,9 @@ import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.With; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import java.io.File; import java.nio.file.Files; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/SearchResult.java b/rewrite-core/src/main/java/org/openrewrite/marker/SearchResult.java index 96a105db392..80a64c379bb 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/SearchResult.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/SearchResult.java @@ -17,10 +17,10 @@ import lombok.*; import lombok.experimental.FieldDefaults; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Incubating; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import java.util.Objects; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/ci/BuildEnvironment.java b/rewrite-core/src/main/java/org/openrewrite/marker/ci/BuildEnvironment.java index 4fdf01406f2..0cb78df5f93 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/ci/BuildEnvironment.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/ci/BuildEnvironment.java @@ -15,7 +15,7 @@ */ package org.openrewrite.marker.ci; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.GitProvenance; import org.openrewrite.marker.Marker; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/ci/JenkinsBuildEnvironment.java b/rewrite-core/src/main/java/org/openrewrite/marker/ci/JenkinsBuildEnvironment.java index 88dbcb7e7b0..a4b7e747392 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/ci/JenkinsBuildEnvironment.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/ci/JenkinsBuildEnvironment.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.GitProvenance; import java.util.UUID; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/package-info.java b/rewrite-core/src/main/java/org/openrewrite/marker/package-info.java index e5cb97bcdc1..a5a52c1ffb3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.marker; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/package-info.java b/rewrite-core/src/main/java/org/openrewrite/package-info.java index fac54ccd518..7b773779b87 100644 --- a/rewrite-core/src/main/java/org/openrewrite/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/quark/Quark.java b/rewrite-core/src/main/java/org/openrewrite/quark/Quark.java index 2413e21ef74..a31b3f45810 100644 --- a/rewrite-core/src/main/java/org/openrewrite/quark/Quark.java +++ b/rewrite-core/src/main/java/org/openrewrite/quark/Quark.java @@ -17,8 +17,8 @@ import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.nio.charset.Charset; diff --git a/rewrite-core/src/main/java/org/openrewrite/quark/QuarkParser.java b/rewrite-core/src/main/java/org/openrewrite/quark/QuarkParser.java index 7a626a1785b..f8e4ff882bb 100644 --- a/rewrite-core/src/main/java/org/openrewrite/quark/QuarkParser.java +++ b/rewrite-core/src/main/java/org/openrewrite/quark/QuarkParser.java @@ -15,12 +15,12 @@ */ package org.openrewrite.quark; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.io.*; diff --git a/rewrite-core/src/main/java/org/openrewrite/quark/package-info.java b/rewrite-core/src/main/java/org/openrewrite/quark/package-info.java index 608600a2fed..84f2ae03073 100644 --- a/rewrite-core/src/main/java/org/openrewrite/quark/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/quark/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.quark; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/LocalRemoteArtifactCache.java b/rewrite-core/src/main/java/org/openrewrite/remote/LocalRemoteArtifactCache.java index 88804f09832..26a4d3ebddc 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/LocalRemoteArtifactCache.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/LocalRemoteArtifactCache.java @@ -15,7 +15,7 @@ */ package org.openrewrite.remote; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.InputStream; import java.net.URI; diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java b/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java index 53b7a496ad1..0608abc19c5 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/Remote.java @@ -16,9 +16,9 @@ package org.openrewrite.remote; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.io.InputStream; diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java index e32dfb9cf78..6d14e1f7e76 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArchive.java @@ -19,11 +19,11 @@ import lombok.Value; import lombok.With; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.Checksum; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.HttpSenderExecutionContextView; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.marker.Markers; diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArtifactCache.java b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArtifactCache.java index 5c9ee55dfd3..e550b530a1b 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArtifactCache.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteArtifactCache.java @@ -15,7 +15,7 @@ */ package org.openrewrite.remote; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.InputStream; import java.net.URI; diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java index 622c1fcc228..40ffa64db27 100644 --- a/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/RemoteFile.java @@ -19,11 +19,11 @@ import lombok.Value; import lombok.With; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.Checksum; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.HttpSenderExecutionContextView; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.marker.Markers; diff --git a/rewrite-core/src/main/java/org/openrewrite/remote/package-info.java b/rewrite-core/src/main/java/org/openrewrite/remote/package-info.java index 4f616e39ade..bedde27587c 100755 --- a/rewrite-core/src/main/java/org/openrewrite/remote/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/remote/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.remote; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/scheduling/RecipeRunCycle.java b/rewrite-core/src/main/java/org/openrewrite/scheduling/RecipeRunCycle.java index 6160d74344c..99a2ef18bac 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scheduling/RecipeRunCycle.java +++ b/rewrite-core/src/main/java/org/openrewrite/scheduling/RecipeRunCycle.java @@ -19,11 +19,11 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.experimental.FieldDefaults; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ExceptionUtils; import org.openrewrite.internal.FindRecipeRunException; import org.openrewrite.internal.RecipeRunException; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Generated; import org.openrewrite.marker.RecipesThatMadeChanges; import org.openrewrite.table.RecipeRunStats; diff --git a/rewrite-core/src/main/java/org/openrewrite/scheduling/WatchableExecutionContext.java b/rewrite-core/src/main/java/org/openrewrite/scheduling/WatchableExecutionContext.java index dc798d4420a..2185bb736c6 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scheduling/WatchableExecutionContext.java +++ b/rewrite-core/src/main/java/org/openrewrite/scheduling/WatchableExecutionContext.java @@ -16,8 +16,8 @@ package org.openrewrite.scheduling; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import java.util.function.BiConsumer; import java.util.function.Consumer; diff --git a/rewrite-core/src/main/java/org/openrewrite/scheduling/package-info.java b/rewrite-core/src/main/java/org/openrewrite/scheduling/package-info.java index 6c321532e4c..eb904c8c857 100644 --- a/rewrite-core/src/main/java/org/openrewrite/scheduling/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/scheduling/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.scheduling; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java b/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java index 8c3c80b06f6..ef0a592eafb 100644 --- a/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java +++ b/rewrite-core/src/main/java/org/openrewrite/search/FindBuildMetadata.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.BuildMetadata; import org.openrewrite.marker.SearchResult; diff --git a/rewrite-core/src/main/java/org/openrewrite/search/FindCommitters.java b/rewrite-core/src/main/java/org/openrewrite/search/FindCommitters.java index 86b425a6479..17075dd1d59 100644 --- a/rewrite-core/src/main/java/org/openrewrite/search/FindCommitters.java +++ b/rewrite-core/src/main/java/org/openrewrite/search/FindCommitters.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.marker.GitProvenance; import org.openrewrite.table.CommitsByDay; import org.openrewrite.table.DistinctCommitters; diff --git a/rewrite-core/src/main/java/org/openrewrite/search/FindParseToPrintInequality.java b/rewrite-core/src/main/java/org/openrewrite/search/FindParseToPrintInequality.java index e9872a9da3f..c4e630832a0 100644 --- a/rewrite-core/src/main/java/org/openrewrite/search/FindParseToPrintInequality.java +++ b/rewrite-core/src/main/java/org/openrewrite/search/FindParseToPrintInequality.java @@ -15,12 +15,12 @@ */ package org.openrewrite.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Recipe; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.InMemoryDiffEntry; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.table.ParseToPrintInequalities; import org.openrewrite.tree.ParseError; diff --git a/rewrite-core/src/main/java/org/openrewrite/search/package-info.java b/rewrite-core/src/main/java/org/openrewrite/search/package-info.java index 87ea745376b..3f2dbfe9e96 100644 --- a/rewrite-core/src/main/java/org/openrewrite/search/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/search/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/CaretRange.java b/rewrite-core/src/main/java/org/openrewrite/semver/CaretRange.java index 58cdd690477..7fb68420ed6 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/CaretRange.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/CaretRange.java @@ -15,8 +15,8 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/DependencyMatcher.java b/rewrite-core/src/main/java/org/openrewrite/semver/DependencyMatcher.java index 60c669b2896..fe6c7032705 100755 --- a/rewrite-core/src/main/java/org/openrewrite/semver/DependencyMatcher.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/DependencyMatcher.java @@ -15,9 +15,9 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.Collection; import java.util.Optional; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersion.java b/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersion.java index 804a77fae79..d88a3cf2644 100755 --- a/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersion.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersion.java @@ -15,8 +15,8 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; /** * Version selector for matching exact version: either explicitly prefixed with "=", diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersionWithPattern.java b/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersionWithPattern.java index 0b4bcae3235..77b4f846087 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersionWithPattern.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/ExactVersionWithPattern.java @@ -15,9 +15,9 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; public class ExactVersionWithPattern extends LatestRelease { private final String version; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/HyphenRange.java b/rewrite-core/src/main/java/org/openrewrite/semver/HyphenRange.java index 307154899e1..210598d6f58 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/HyphenRange.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/HyphenRange.java @@ -15,8 +15,8 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/LatestIntegration.java b/rewrite-core/src/main/java/org/openrewrite/semver/LatestIntegration.java index bd07189d38c..dfbbdfc4d48 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/LatestIntegration.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/LatestIntegration.java @@ -15,9 +15,9 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/LatestPatch.java b/rewrite-core/src/main/java/org/openrewrite/semver/LatestPatch.java index caae7755184..2c90e3c40ca 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/LatestPatch.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/LatestPatch.java @@ -16,8 +16,8 @@ package org.openrewrite.semver; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; @Value public class LatestPatch implements VersionComparator { diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/LatestRelease.java b/rewrite-core/src/main/java/org/openrewrite/semver/LatestRelease.java index d9369967a3b..947cf16e795 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/LatestRelease.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/LatestRelease.java @@ -15,9 +15,9 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/Semver.java b/rewrite-core/src/main/java/org/openrewrite/semver/Semver.java index 619c82d2b88..37944d04dcb 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/Semver.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/Semver.java @@ -15,9 +15,9 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.Scanner; import java.util.regex.Pattern; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/SetRange.java b/rewrite-core/src/main/java/org/openrewrite/semver/SetRange.java index 34dc420ceb7..39fa6e62676 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/SetRange.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/SetRange.java @@ -15,8 +15,8 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/TildeRange.java b/rewrite-core/src/main/java/org/openrewrite/semver/TildeRange.java index 37bfab832f5..3d0d3b94a76 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/TildeRange.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/TildeRange.java @@ -15,8 +15,8 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/VersionComparator.java b/rewrite-core/src/main/java/org/openrewrite/semver/VersionComparator.java index 780f50d49e4..1767e13f046 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/VersionComparator.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/VersionComparator.java @@ -15,7 +15,7 @@ */ package org.openrewrite.semver; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.Collection; import java.util.Comparator; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/XRange.java b/rewrite-core/src/main/java/org/openrewrite/semver/XRange.java index 37978c6ba7c..6b95f2c0bbf 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/XRange.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/XRange.java @@ -15,8 +15,8 @@ */ package org.openrewrite.semver; +import org.jspecify.annotations.Nullable; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/rewrite-core/src/main/java/org/openrewrite/semver/package-info.java b/rewrite-core/src/main/java/org/openrewrite/semver/package-info.java index 0bddfa70abe..fe960467169 100644 --- a/rewrite-core/src/main/java/org/openrewrite/semver/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/semver/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.semver; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/style/NamedStyles.java b/rewrite-core/src/main/java/org/openrewrite/style/NamedStyles.java index 8ac29fadbe6..ab5d86e9691 100644 --- a/rewrite-core/src/main/java/org/openrewrite/style/NamedStyles.java +++ b/rewrite-core/src/main/java/org/openrewrite/style/NamedStyles.java @@ -19,10 +19,10 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.NlsRewrite; import org.openrewrite.Tree; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import java.util.*; diff --git a/rewrite-core/src/main/java/org/openrewrite/style/package-info.java b/rewrite-core/src/main/java/org/openrewrite/style/package-info.java index 8fe368b70ae..71f6f928a9d 100755 --- a/rewrite-core/src/main/java/org/openrewrite/style/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/style/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.style; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/table/DeserializationErrorTable.java b/rewrite-core/src/main/java/org/openrewrite/table/DeserializationErrorTable.java index a0156fac959..34eebca1747 100644 --- a/rewrite-core/src/main/java/org/openrewrite/table/DeserializationErrorTable.java +++ b/rewrite-core/src/main/java/org/openrewrite/table/DeserializationErrorTable.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; @JsonIgnoreType public class DeserializationErrorTable extends DataTable { diff --git a/rewrite-core/src/main/java/org/openrewrite/table/LstProvenanceTable.java b/rewrite-core/src/main/java/org/openrewrite/table/LstProvenanceTable.java index 02b4652592e..4acff3f13e7 100644 --- a/rewrite-core/src/main/java/org/openrewrite/table/LstProvenanceTable.java +++ b/rewrite-core/src/main/java/org/openrewrite/table/LstProvenanceTable.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.LstProvenance; @JsonIgnoreType diff --git a/rewrite-core/src/main/java/org/openrewrite/table/ParseFailures.java b/rewrite-core/src/main/java/org/openrewrite/table/ParseFailures.java index c6060170c77..08b71636f44 100644 --- a/rewrite-core/src/main/java/org/openrewrite/table/ParseFailures.java +++ b/rewrite-core/src/main/java/org/openrewrite/table/ParseFailures.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; @JsonIgnoreType public class ParseFailures extends DataTable { diff --git a/rewrite-core/src/main/java/org/openrewrite/table/ParseToPrintInequalities.java b/rewrite-core/src/main/java/org/openrewrite/table/ParseToPrintInequalities.java index 08ef688aa3c..d652ea3fa1d 100644 --- a/rewrite-core/src/main/java/org/openrewrite/table/ParseToPrintInequalities.java +++ b/rewrite-core/src/main/java/org/openrewrite/table/ParseToPrintInequalities.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; @JsonIgnoreType public class ParseToPrintInequalities extends DataTable { diff --git a/rewrite-core/src/main/java/org/openrewrite/table/RecipeRunStats.java b/rewrite-core/src/main/java/org/openrewrite/table/RecipeRunStats.java index ddde328a2b9..dcdb58d897c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/table/RecipeRunStats.java +++ b/rewrite-core/src/main/java/org/openrewrite/table/RecipeRunStats.java @@ -19,8 +19,8 @@ import io.micrometer.core.instrument.Timer; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import java.nio.file.Path; import java.util.ArrayList; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/AppendToTextFile.java b/rewrite-core/src/main/java/org/openrewrite/text/AppendToTextFile.java index dcd586fd5a3..bb435c61c80 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/AppendToTextFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/AppendToTextFile.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java b/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java index 9718096f17c..6ae54f6943c 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/CreateTextFile.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/EndOfLineAtEndOfFile.java b/rewrite-core/src/main/java/org/openrewrite/text/EndOfLineAtEndOfFile.java index 52f2bff5501..e02fa46cd84 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/EndOfLineAtEndOfFile.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/EndOfLineAtEndOfFile.java @@ -15,9 +15,9 @@ */ package org.openrewrite.text; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.binary.Binary; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.quark.Quark; import org.openrewrite.remote.Remote; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/Find.java b/rewrite-core/src/main/java/org/openrewrite/text/Find.java index d9270d801d6..90450be6d64 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/Find.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/Find.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.binary.Binary; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.marker.SearchResult; import org.openrewrite.quark.Quark; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java b/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java index 496855b67bc..0842da78a57 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.binary.Binary; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.AlreadyReplaced; import org.openrewrite.marker.Marker; import org.openrewrite.marker.SearchResult; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/FindMultiselect.java b/rewrite-core/src/main/java/org/openrewrite/text/FindMultiselect.java index 5a96a03b720..0f86ec1054b 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/FindMultiselect.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/FindMultiselect.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.binary.Binary; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.marker.SearchResult; import org.openrewrite.quark.Quark; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/PlainText.java b/rewrite-core/src/main/java/org/openrewrite/text/PlainText.java index f6c4ffd1684..6ccab32adf8 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/PlainText.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/PlainText.java @@ -16,8 +16,8 @@ package org.openrewrite.text; import lombok.*; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.nio.charset.Charset; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/PlainTextParser.java b/rewrite-core/src/main/java/org/openrewrite/text/PlainTextParser.java index 390ef138c35..d7da58e2be6 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/PlainTextParser.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/PlainTextParser.java @@ -15,11 +15,11 @@ */ package org.openrewrite.text; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.tree.ParseError; import org.openrewrite.tree.ParsingEventListener; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/package-info.java b/rewrite-core/src/main/java/org/openrewrite/text/package-info.java index 9f05ebd5886..fed4f8885c3 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.text; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/trait/SimpleTraitMatcher.java b/rewrite-core/src/main/java/org/openrewrite/trait/SimpleTraitMatcher.java index 5c6f6426372..4faa5e00dbc 100644 --- a/rewrite-core/src/main/java/org/openrewrite/trait/SimpleTraitMatcher.java +++ b/rewrite-core/src/main/java/org/openrewrite/trait/SimpleTraitMatcher.java @@ -15,11 +15,11 @@ */ package org.openrewrite.trait; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Incubating; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import java.util.Iterator; import java.util.Optional; diff --git a/rewrite-core/src/main/java/org/openrewrite/trait/package-info.java b/rewrite-core/src/main/java/org/openrewrite/trait/package-info.java index 3faba8eca23..3307633b6ae 100644 --- a/rewrite-core/src/main/java/org/openrewrite/trait/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/trait/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.trait; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/main/java/org/openrewrite/tree/ParseError.java b/rewrite-core/src/main/java/org/openrewrite/tree/ParseError.java index 66a683ad7a6..6a8723b64e7 100644 --- a/rewrite-core/src/main/java/org/openrewrite/tree/ParseError.java +++ b/rewrite-core/src/main/java/org/openrewrite/tree/ParseError.java @@ -19,9 +19,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.nio.charset.Charset; diff --git a/rewrite-core/src/main/java/org/openrewrite/tree/ParsingExecutionContextView.java b/rewrite-core/src/main/java/org/openrewrite/tree/ParsingExecutionContextView.java index 673ed760b19..50270d48f58 100644 --- a/rewrite-core/src/main/java/org/openrewrite/tree/ParsingExecutionContextView.java +++ b/rewrite-core/src/main/java/org/openrewrite/tree/ParsingExecutionContextView.java @@ -15,9 +15,9 @@ */ package org.openrewrite.tree; +import org.jspecify.annotations.Nullable; import org.openrewrite.DelegatingExecutionContext; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import java.nio.charset.Charset; diff --git a/rewrite-core/src/main/java/org/openrewrite/tree/package-info.java b/rewrite-core/src/main/java/org/openrewrite/tree/package-info.java index ec5c8b669d3..7ee81a225e5 100644 --- a/rewrite-core/src/main/java/org/openrewrite/tree/package-info.java +++ b/rewrite-core/src/main/java/org/openrewrite/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java b/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java index b105f820a2d..5e7f2951450 100644 --- a/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/PreconditionsTest.java @@ -15,8 +15,8 @@ */ package org.openrewrite; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java b/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java index 828c4612b8f..c7208556ce2 100644 --- a/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/RecipeLifecycleTest.java @@ -19,11 +19,11 @@ import lombok.NoArgsConstructor; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.config.Environment; import org.openrewrite.config.RecipeDescriptor; import org.openrewrite.config.YamlResourceLoader; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.test.RewriteTest; import org.openrewrite.text.FindAndReplace; diff --git a/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java b/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java index e56200423b6..a67aa63ccbf 100644 --- a/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/RecipeSchedulerTest.java @@ -16,10 +16,10 @@ package org.openrewrite; import lombok.AllArgsConstructor; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.openrewrite.config.DeclarativeRecipe; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markup; import org.openrewrite.scheduling.WorkingDirectoryExecutionContextView; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-core/src/test/java/org/openrewrite/TreeVisitorTest.java b/rewrite-core/src/test/java/org/openrewrite/TreeVisitorTest.java index e6e4423af37..7af495cf8f9 100644 --- a/rewrite-core/src/test/java/org/openrewrite/TreeVisitorTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/TreeVisitorTest.java @@ -15,8 +15,8 @@ */ package org.openrewrite; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.quark.Quark; diff --git a/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java b/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java index ef7b9b90314..a70b9c7701d 100644 --- a/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.*; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.test.RewriteTest; import org.openrewrite.text.ChangeText; diff --git a/rewrite-core/src/test/java/org/openrewrite/internal/lang/nonnull/DefaultNonNullTest.java b/rewrite-core/src/test/java/org/openrewrite/internal/lang/nonnull/DefaultNonNullTest.java index 37ea15af555..35a3cb9312c 100644 --- a/rewrite-core/src/test/java/org/openrewrite/internal/lang/nonnull/DefaultNonNullTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/internal/lang/nonnull/DefaultNonNullTest.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal.lang.nonnull; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; public class DefaultNonNullTest { diff --git a/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java b/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java index d93a093652f..60388bc75af 100644 --- a/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal.lang.nullable; -import org.openrewrite.internal.lang.NonNull; +import org.jspecify.annotations.NonNull; @SuppressWarnings("ALL") public class NonNullTest { diff --git a/rewrite-core/src/test/java/org/openrewrite/package-info.java b/rewrite-core/src/test/java/org/openrewrite/package-info.java index fac54ccd518..7b773779b87 100644 --- a/rewrite-core/src/test/java/org/openrewrite/package-info.java +++ b/rewrite-core/src/test/java/org/openrewrite/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-core/src/test/java/org/openrewrite/quark/QuarkParserTest.java b/rewrite-core/src/test/java/org/openrewrite/quark/QuarkParserTest.java index ca4d288a01b..23fb68b85ef 100644 --- a/rewrite-core/src/test/java/org/openrewrite/quark/QuarkParserTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/quark/QuarkParserTest.java @@ -15,10 +15,10 @@ */ package org.openrewrite.quark; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.jgit.api.Git; import org.openrewrite.jgit.api.errors.GitAPIException; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-core/src/test/java/org/openrewrite/quark/QuarkTest.java b/rewrite-core/src/test/java/org/openrewrite/quark/QuarkTest.java index 237798ed04a..491ff5f75e3 100644 --- a/rewrite-core/src/test/java/org/openrewrite/quark/QuarkTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/quark/QuarkTest.java @@ -15,9 +15,9 @@ */ package org.openrewrite.quark; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-core/src/test/java/org/openrewrite/quark/package-info.java b/rewrite-core/src/test/java/org/openrewrite/quark/package-info.java index 375f8f5a324..0656b1c91b8 100644 --- a/rewrite-core/src/test/java/org/openrewrite/quark/package-info.java +++ b/rewrite-core/src/test/java/org/openrewrite/quark/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.quark; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-core/src/test/java/org/openrewrite/remote/RemoteVisitorTest.java b/rewrite-core/src/test/java/org/openrewrite/remote/RemoteVisitorTest.java index ce8ccba729d..3053b706043 100644 --- a/rewrite-core/src/test/java/org/openrewrite/remote/RemoteVisitorTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/remote/RemoteVisitorTest.java @@ -15,9 +15,9 @@ */ package org.openrewrite.remote; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.net.URI; diff --git a/rewrite-core/src/test/java/org/openrewrite/table/package-info.java b/rewrite-core/src/test/java/org/openrewrite/table/package-info.java index da390ad4611..be2f0db5331 100644 --- a/rewrite-core/src/test/java/org/openrewrite/table/package-info.java +++ b/rewrite-core/src/test/java/org/openrewrite/table/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.table; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependency.java index e71d0e2f8f2..fa7565211e5 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependency.java @@ -17,13 +17,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.JavaProject; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.search.UsesType; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependencyVisitor.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependencyVisitor.java index 3c87062f181..61659730458 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependencyVisitor.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddDependencyVisitor.java @@ -16,6 +16,7 @@ package org.openrewrite.gradle; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.InMemoryExecutionContext; @@ -27,7 +28,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddProperty.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddProperty.java index 8c2e373f16f..3b11447594a 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddProperty.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/AddProperty.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.properties.ChangePropertyValue; import org.openrewrite.properties.PropertiesParser; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/Assertions.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/Assertions.java index c5da707b506..ab91480d22c 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/Assertions.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/Assertions.java @@ -16,11 +16,11 @@ package org.openrewrite.gradle; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.Parser; import org.openrewrite.SourceFile; import org.openrewrite.groovy.GroovyParser; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; import org.openrewrite.test.UncheckedConsumer; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java index 83aa7ddc9a9..475ba095104 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependency.java @@ -18,6 +18,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; @@ -29,7 +30,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java index 16997e2db3e..4cbec6a2685 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyArtifactId.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; @@ -27,7 +28,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java index 86be691bc61..0e0abaa4954 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyClassifier.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.gradle.util.Dependency; @@ -25,7 +26,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java index fa817da83be..c68b552be14 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyConfiguration.java @@ -17,13 +17,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.util.Dependency; import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java index d96fbfb9e4d..fb3054f6847 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyExtension.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.gradle.util.Dependency; @@ -25,7 +26,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java index 11e34143230..6fc3a3faae4 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/ChangeDependencyGroupId.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; @@ -27,7 +28,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyConstraintToRule.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyConstraintToRule.java index 1754fde5f7c..b0867c41771 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyConstraintToRule.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyConstraintToRule.java @@ -18,12 +18,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.GroovyParser; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java index 3cf3120f06b..4d0e35406a1 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyUseStringNotation.java @@ -15,13 +15,13 @@ */ package org.openrewrite.gradle; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; @@ -118,7 +118,7 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) return m; } - private @Nullable J.Literal toLiteral(Space prefix, Markers markers, Map mapNotation) { + private J.@Nullable Literal toLiteral(Space prefix, Markers markers, Map mapNotation) { if (mapNotation.containsKey("group") && mapNotation.containsKey("name")) { String stringNotation = ""; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyVersionSelector.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyVersionSelector.java index 910bb9e33f5..90a6019344d 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyVersionSelector.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/DependencyVersionSelector.java @@ -16,12 +16,12 @@ package org.openrewrite.gradle; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Incubating; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.marker.GradleSettings; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.table.MavenMetadataFailures; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/GradleParser.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/GradleParser.java index 8a7428d7c60..22ecd30ec7d 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/GradleParser.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/GradleParser.java @@ -16,6 +16,7 @@ package org.openrewrite.gradle; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.Parser; @@ -23,7 +24,6 @@ import org.openrewrite.gradle.internal.DefaultImportsCustomizer; import org.openrewrite.groovy.GroovyParser; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import java.nio.file.Path; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsBuildGradle.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsBuildGradle.java index 55d53f6f95c..6ec3e360e14 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsBuildGradle.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsBuildGradle.java @@ -15,9 +15,9 @@ */ package org.openrewrite.gradle; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.JavaSourceFile; import org.openrewrite.marker.SearchResult; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsSettingsGradle.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsSettingsGradle.java index 02e37ae143d..8bdf7f559c9 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsSettingsGradle.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/IsSettingsGradle.java @@ -15,9 +15,9 @@ */ package org.openrewrite.gradle; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.JavaSourceFile; import org.openrewrite.marker.SearchResult; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveDependency.java index 787823c0971..2335900e825 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/RemoveDependency.java @@ -18,6 +18,7 @@ import io.micrometer.core.instrument.util.StringUtils; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; @@ -26,7 +27,6 @@ import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java index 708b0dda40f..7c560e0a126 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateGradleWrapper.java @@ -21,12 +21,12 @@ import lombok.RequiredArgsConstructor; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.search.FindGradleProject; import org.openrewrite.gradle.util.GradleWrapper; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.BuildTool; import org.openrewrite.marker.Markers; import org.openrewrite.properties.PropertiesParser; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java index 4c16700b068..5ce95859218 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpdateJavaCompatibility.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.util.ChangeStringLiteral; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java index 48c0ebce4fb..3f0b19d8f10 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeDependencyVersion.java @@ -18,6 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.RequiredArgsConstructor; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; @@ -29,7 +30,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersion.java index a462f839aac..a529fca5d91 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/UpgradeTransitiveDependencyVersion.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; @@ -25,7 +26,6 @@ import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.format.BlankLinesVisitor; import org.openrewrite.java.search.FindMethods; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/FeaturePreview.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/FeaturePreview.java index ad83d85f1c3..4c342577b07 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/FeaturePreview.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/FeaturePreview.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleDependencyConfiguration.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleDependencyConfiguration.java index 43c08122e98..2512327c82c 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleDependencyConfiguration.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleDependencyConfiguration.java @@ -18,8 +18,8 @@ import lombok.Value; import lombok.With; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.Dependency; import org.openrewrite.maven.tree.ResolvedDependency; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradlePluginDescriptor.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradlePluginDescriptor.java index 934c971630c..0f22c4e76b2 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradlePluginDescriptor.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradlePluginDescriptor.java @@ -16,7 +16,7 @@ package org.openrewrite.gradle.marker; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java index a98f5a35ce8..3e77f0bdd4f 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleProject.java @@ -19,7 +19,7 @@ import lombok.AllArgsConstructor; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.maven.tree.MavenRepository; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleSettings.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleSettings.java index 13eb5a62dc2..e231f56e365 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleSettings.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/GradleSettings.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.maven.tree.MavenRepository; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/package-info.java index 96f6e264ba3..b1991d35546 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/package-info.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/marker/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.marker; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/package-info.java index abc0668e0a5..1531b34cafd 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/package-info.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddBuildPlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddBuildPlugin.java index 3e9ef696b9a..3acdda2ff7e 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddBuildPlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddBuildPlugin.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.search.FindGradleProject; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.semver.Semver; @Value diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePlugin.java index 25e3c007547..27c40fa6301 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddDevelocityGradlePlugin.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.DependencyVersionSelector; import org.openrewrite.gradle.GradleParser; @@ -27,7 +28,6 @@ import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.style.IntelliJ; import org.openrewrite.java.style.TabsAndIndentsStyle; import org.openrewrite.java.tree.J; @@ -245,7 +245,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Atomi return found.get(); } - private @Nullable J.MethodInvocation gradleEnterpriseDsl(String newVersion, VersionComparator versionComparator, String indent, ExecutionContext ctx) { + private J.@Nullable MethodInvocation gradleEnterpriseDsl(String newVersion, VersionComparator versionComparator, String indent, ExecutionContext ctx) { if (server == null && allowUntrustedServer == null && captureTaskInputFiles == null && uploadInBackground == null && publishCriteria == null) { return null; } diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddPluginVisitor.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddPluginVisitor.java index 4424f11251e..6dc13d46ea7 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddPluginVisitor.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddPluginVisitor.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.gradle.DependencyVersionSelector; @@ -27,7 +28,6 @@ import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.search.FindMethods; import org.openrewrite.java.tree.*; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddSettingsPlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddSettingsPlugin.java index 86335e67db9..9abdd8f6a84 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddSettingsPlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/AddSettingsPlugin.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.IsSettingsGradle; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.semver.Semver; @Value diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java index 87129f5b0a3..4bc90b42be2 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePlugin.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.DependencyVersionSelector; import org.openrewrite.gradle.IsBuildGradle; @@ -29,7 +30,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePluginVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePluginVersion.java index 26cfd2bb95f..89bbde59d98 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePluginVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/ChangePluginVersion.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.DependencyVersionSelector; import org.openrewrite.gradle.IsBuildGradle; @@ -27,7 +28,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocity.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocity.java index a822a3d46a9..29b0d8a0636 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocity.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/MigrateGradleEnterpriseToDevelocity.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.DependencyVersionSelector; import org.openrewrite.gradle.GradleParser; @@ -25,7 +26,6 @@ import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.style.IntelliJ; import org.openrewrite.java.style.TabsAndIndentsStyle; import org.openrewrite.java.tree.*; @@ -101,7 +101,7 @@ public G.CompilationUnit visitCompilationUnit(G.CompilationUnit cu, ExecutionCon private static class MigrateConfigurationVisitor extends GroovyIsoVisitor { @Override - public @Nullable J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { J.MethodInvocation m = super.visitMethodInvocation(method, ctx); if (m.getSimpleName().equals("gradleEnterprise") && m.getArguments().size() == 1 && m.getArguments().get(0) instanceof J.Lambda) { return m.withName(m.getName().withSimpleName("develocity")); @@ -236,7 +236,7 @@ private boolean withinMethodInvocations(List methods) { return null; } - private @Nullable J.MethodInvocation develocityPublishAlwaysIfDsl(String indent, ExecutionContext ctx) { + private J.@Nullable MethodInvocation develocityPublishAlwaysIfDsl(String indent, ExecutionContext ctx) { StringBuilder ge = new StringBuilder("\ndevelocity {\n"); ge.append(indent).append("buildScan {\n"); ge.append(indent).append(indent).append("publishing.onlyIf { true }\n"); @@ -255,7 +255,7 @@ private boolean withinMethodInvocations(List methods) { return (J.MethodInvocation) ((J.Return) ((J.Block) ((J.Lambda) buildScan.getArguments().get(0)).getBody()).getStatements().get(0)).getExpression(); } - private @Nullable J.MethodInvocation develocityPublishOnFailureIfDsl(String indent, ExecutionContext ctx) { + private J.@Nullable MethodInvocation develocityPublishOnFailureIfDsl(String indent, ExecutionContext ctx) { StringBuilder ge = new StringBuilder("\ndevelocity {\n"); ge.append(indent).append("buildScan {\n"); ge.append(indent).append(indent).append("publishing.onlyIf { !it.buildResult.failures.empty }\n"); diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java index 4cbb1e6b091..329cec7121c 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/UpgradePluginVersion.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.DependencyVersionSelector; import org.openrewrite.gradle.IsBuildGradle; @@ -28,7 +29,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/package-info.java index 34ae7f26d29..1bd37282bff 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/package-info.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/plugins/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.plugins; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/DependencyInsight.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/DependencyInsight.java index 940a7459d13..19e4bc9b445 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/DependencyInsight.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/DependencyInsight.java @@ -19,11 +19,11 @@ import lombok.EqualsAndHashCode; import lombok.RequiredArgsConstructor; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.marker.JavaProject; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java index b9af57f42de..81553ddc493 100755 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindDependency.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.IsBuildGradle; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleProject.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleProject.java index 10745cfd788..f5bf756391a 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleProject.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleProject.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.marker.GradleProject; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.JavaSourceFile; import org.openrewrite.marker.SearchResult; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleWrapper.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleWrapper.java index ad4543ef31d..70fc6d410c1 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleWrapper.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindGradleWrapper.java @@ -17,13 +17,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.gradle.table.GradleWrappersInUse; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.properties.PropertiesVisitor; import org.openrewrite.properties.tree.Properties; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindPlugins.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindPlugins.java index b19daa6e5f5..14a52457859 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindPlugins.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindPlugins.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.IsBuildGradle; import org.openrewrite.gradle.IsSettingsGradle; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.tree.GradlePlugin; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindRepository.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindRepository.java index f494ba411a8..c72774bd282 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindRepository.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/FindRepository.java @@ -17,13 +17,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.gradle.IsBuildGradle; import org.openrewrite.gradle.IsSettingsGradle; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.groovy.GroovyPrinter; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/package-info.java index 390fa215651..f8b79567eb7 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/package-info.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/search/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/package-info.java index 578827aab4f..c3ecdb70c86 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/package-info.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/security/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.security; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java index f2a285cb743..c5e41fec132 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java @@ -17,12 +17,12 @@ import lombok.Getter; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; import org.openrewrite.gradle.util.DependencyStringNotationConverter; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; import org.openrewrite.maven.tree.Dependency; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleTraitMatcher.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleTraitMatcher.java index 7003d073d77..4f749ee2855 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleTraitMatcher.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleTraitMatcher.java @@ -15,10 +15,10 @@ */ package org.openrewrite.gradle.trait; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.gradle.marker.GradleProject; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.trait.SimpleTraitMatcher; import org.openrewrite.trait.Trait; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/package-info.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/package-info.java index 75cfc2dcf76..83aa0354016 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/package-info.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.gradle.trait; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/tree/GradlePlugin.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/tree/GradlePlugin.java index 2cd9a4b8e57..e06160f74a5 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/tree/GradlePlugin.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/tree/GradlePlugin.java @@ -16,7 +16,7 @@ package org.openrewrite.gradle.tree; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.J; @Value diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java index 9e114832b32..9fd440d188a 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/Dependency.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.tree.GroupArtifactVersion; @Value diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java index fa1c6893565..47646439ce1 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DependencyStringNotationConverter.java @@ -15,7 +15,7 @@ */ package org.openrewrite.gradle.util; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; public class DependencyStringNotationConverter { diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java index bca992c56ff..0a0040e1526 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/DistributionInfos.java @@ -16,8 +16,8 @@ package org.openrewrite.gradle.util; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Checksum; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpSender; import java.io.IOException; diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java index 61ff6c83429..6459cc8588d 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/util/GradleWrapper.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; 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.ipc.http.HttpSender; import org.openrewrite.remote.Remote; import org.openrewrite.semver.LatestRelease; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java index ca2afe77a9a..42596fb4002 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/AddDependencyTest.java @@ -16,13 +16,13 @@ package org.openrewrite.gradle; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.openrewrite.Issue; import org.openrewrite.gradle.marker.GradleDependencyConfiguration; import org.openrewrite.gradle.marker.GradleProject; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java index 92a271e7469..91f8b6b85cf 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/UpdateGradleWrapperTest.java @@ -15,10 +15,10 @@ */ package org.openrewrite.gradle; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.ipc.http.HttpUrlConnectionSender; import org.openrewrite.marker.BuildTool; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/package-info.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/package-info.java index abc0668e0a5..1531b34cafd 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/package-info.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/package-info.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/package-info.java index 34ae7f26d29..1bd37282bff 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/package-info.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/plugins/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.plugins; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/package-info.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/package-info.java index 390fa215651..f8b79567eb7 100755 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/package-info.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/search/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java index 1487503fbae..21d47b90b5e 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java @@ -21,8 +21,8 @@ import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; +import org.jspecify.annotations.NonNull; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNull; import java.io.IOException; import java.io.InputStream; diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java index 143f2e81d0f..f9779830141 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.gradle.util; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/Assertions.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/Assertions.java index db45b9872bf..a377079874f 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/Assertions.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/Assertions.java @@ -17,9 +17,9 @@ import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyAstTypeSignatureBuilder.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyAstTypeSignatureBuilder.java index 1a38174e3b2..bea2fca522d 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyAstTypeSignatureBuilder.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyAstTypeSignatureBuilder.java @@ -16,7 +16,7 @@ package org.openrewrite.groovy; import org.codehaus.groovy.ast.*; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import java.util.HashSet; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParser.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParser.java index e0f1ed7b378..9818abe106a 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParser.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParser.java @@ -25,9 +25,9 @@ import org.codehaus.groovy.control.messages.WarningMessage; import org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.groovy.tree.G; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.marker.Markers; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java index 58aa3217411..da9789e138c 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java @@ -25,6 +25,8 @@ import org.codehaus.groovy.ast.stmt.*; import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.transform.stc.StaticTypesMarker; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; @@ -32,8 +34,6 @@ import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.ImplicitReturn; import org.openrewrite.java.marker.Semicolon; @@ -2132,7 +2132,7 @@ private static class LineColumn implements Comparable { int column; @Override - public int compareTo(@NonNull GroovyParserVisitor.LineColumn lc) { + public int compareTo(GroovyParserVisitor.@NonNull LineColumn lc) { return line != lc.line ? line - lc.line : column - lc.column; } } diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java index 77aff96306f..223036f95c2 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java @@ -15,6 +15,7 @@ */ package org.openrewrite.groovy; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.PrintOutputCapture; import org.openrewrite.Tree; @@ -23,7 +24,6 @@ import org.openrewrite.groovy.tree.GContainer; import org.openrewrite.groovy.tree.GRightPadded; import org.openrewrite.groovy.tree.GSpace; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaPrinter; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Marker; @@ -444,7 +444,7 @@ private void beforeSyntax(G g, GSpace.Location loc, PrintOutputCapture

p) { beforeSyntax(g.getPrefix(), g.getMarkers(), loc, p); } - private void beforeSyntax(Space prefix, Markers markers, @Nullable GSpace.Location loc, PrintOutputCapture

p) { + private void beforeSyntax(Space prefix, Markers markers, GSpace.@Nullable Location loc, PrintOutputCapture

p) { for (Marker marker : markers.getMarkers()) { p.append(p.getMarkerPrinter().beforePrefix(marker, new Cursor(getCursor(), marker), JAVA_MARKER_WRAPPER)); } @@ -457,7 +457,7 @@ private void beforeSyntax(Space prefix, Markers markers, @Nullable GSpace.Locati } } - private void beforeSyntax(Space prefix, Markers markers, @Nullable Space.Location loc, PrintOutputCapture

p) { + private void beforeSyntax(Space prefix, Markers markers, Space.@Nullable Location loc, PrintOutputCapture

p) { for (Marker marker : markers.getMarkers()) { p.append(p.getMarkerPrinter().beforePrefix(marker, new Cursor(getCursor(), marker), JAVA_MARKER_WRAPPER)); } diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyTypeMapping.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyTypeMapping.java index 616443692c9..56eb0efdff9 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyTypeMapping.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyTypeMapping.java @@ -17,7 +17,7 @@ import org.codehaus.groovy.GroovyBugError; import org.codehaus.groovy.ast.*; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeMapping; import org.openrewrite.java.internal.JavaReflectionTypeMapping; import org.openrewrite.java.internal.JavaTypeCache; @@ -203,7 +203,7 @@ private JavaType genericType(GenericsType g, String signature) { return gtv; } - public @Nullable JavaType.Method methodType(@Nullable MethodNode node) { + public JavaType.@Nullable Method methodType(@Nullable MethodNode node) { if (node == null) { return null; } @@ -264,7 +264,7 @@ private JavaType genericType(GenericsType g, String signature) { return method; } - public @Nullable JavaType.Variable variableType(@Nullable FieldNode node) { + public JavaType.@Nullable Variable variableType(@Nullable FieldNode node) { if (node == null) { return null; } @@ -293,11 +293,11 @@ private JavaType genericType(GenericsType g, String signature) { /** * With an undefined owner */ - public @Nullable JavaType.Variable variableType(String name, @Nullable ASTNode type) { + public JavaType.@Nullable Variable variableType(String name, @Nullable ASTNode type) { return variableType(name, type(type)); } - public @Nullable JavaType.Variable variableType(String name, @Nullable JavaType type) { + public JavaType.@Nullable Variable variableType(String name, @Nullable JavaType type) { if (type == null) { return null; } diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyVisitor.java index 6f1fd407214..4ddd4d26f7f 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.groovy; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.groovy.tree.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.tree.*; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/AutoFormatVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/AutoFormatVisitor.java index 3280d1da89c..8d2c108146c 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/AutoFormatVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/AutoFormatVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.groovy.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; import org.openrewrite.groovy.GroovyIsoVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.format.*; import org.openrewrite.java.style.*; import org.openrewrite.java.tree.J; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/MinimumViableSpacingVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/MinimumViableSpacingVisitor.java index bd803bafb1b..051fc27eeff 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/MinimumViableSpacingVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/MinimumViableSpacingVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.groovy.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.OmitParentheses; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesForLastArgumentLambdaVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesForLastArgumentLambdaVisitor.java index ee16d624e4e..25d4e955a1e 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesForLastArgumentLambdaVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesForLastArgumentLambdaVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.groovy.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.groovy.GroovyIsoVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.OmitParentheses; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesFormat.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesFormat.java index 6bf067b7a37..1f2ed42f5f8 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesFormat.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/OmitParenthesesFormat.java @@ -15,9 +15,9 @@ */ package org.openrewrite.groovy.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.groovy.style.OmitParenthesesStyle; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/package-info.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/package-info.java index 7115ce2aaeb..d41ba3aa4f9 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/package-info.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/format/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.groovy.format; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/internal/package-info.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/internal/package-info.java index 87c80ab28b5..ff962f6bfe9 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/internal/package-info.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.groovy.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/package-info.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/package-info.java index a8d572d39d9..57608bf70be 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/package-info.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/marker/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.groovy.marker; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/package-info.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/package-info.java index fe7162e5404..1941a011a65 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/package-info.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.groovy; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/service/GroovyAutoFormatService.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/service/GroovyAutoFormatService.java index f27cc41773e..5818e4f0f49 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/service/GroovyAutoFormatService.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/service/GroovyAutoFormatService.java @@ -15,9 +15,9 @@ */ package org.openrewrite.groovy.service; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.groovy.format.AutoFormatVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.service.AutoFormatService; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/style/package-info.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/style/package-info.java index cc2a77121b9..3c555e1b12c 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/style/package-info.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/style/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.groovy.style; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/G.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/G.java index 60198f49883..a051947d51a 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/G.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/G.java @@ -18,13 +18,13 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.groovy.GroovyPrinter; import org.openrewrite.groovy.GroovyVisitor; import org.openrewrite.groovy.internal.GroovyWhitespaceValidationService; import org.openrewrite.groovy.service.GroovyAutoFormatService; import org.openrewrite.internal.WhitespaceValidationService; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.TypesInUse; import org.openrewrite.java.service.AutoFormatService; import org.openrewrite.java.tree.*; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/package-info.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/package-info.java index d5376f84c00..12f37643d9f 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/package-info.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.groovy.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java b/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java index cd634d65a5a..a1fbeb1129c 100644 --- a/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java +++ b/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java @@ -15,12 +15,12 @@ */ package org.openrewrite.groovy; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.groovy.tree.G; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaTypeMappingTest; import org.openrewrite.java.JavaTypeVisitor; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/Assertions.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/Assertions.java index dd166ac4e2c..4c93392f02a 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/Assertions.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/Assertions.java @@ -15,8 +15,8 @@ */ package org.openrewrite.hcl; +import org.jspecify.annotations.Nullable; import org.openrewrite.hcl.tree.Hcl; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclParser.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclParser.java index 9e75d88a0fd..11a9b4bb5c9 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclParser.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclParser.java @@ -16,6 +16,7 @@ package org.openrewrite.hcl; import org.antlr.v4.runtime.*; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; @@ -24,7 +25,6 @@ import org.openrewrite.hcl.internal.grammar.HCLParser; import org.openrewrite.hcl.tree.Hcl; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.style.NamedStyles; import org.openrewrite.tree.ParseError; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclVisitor.java index 9755771edca..53a72c688f8 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/HclVisitor.java @@ -15,13 +15,13 @@ */ package org.openrewrite.hcl; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.TreeVisitor; import org.openrewrite.hcl.format.AutoFormatVisitor; import org.openrewrite.hcl.tree.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.List; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/JsonPathMatcher.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/JsonPathMatcher.java index a8a44de766f..fe3a56f2749 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/JsonPathMatcher.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/JsonPathMatcher.java @@ -21,6 +21,7 @@ import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; import org.openrewrite.hcl.internal.grammar.JsonPathLexer; @@ -28,7 +29,6 @@ import org.openrewrite.hcl.internal.grammar.JsonPathParserBaseVisitor; import org.openrewrite.hcl.internal.grammar.JsonPathParserVisitor; import org.openrewrite.hcl.tree.Hcl; -import org.openrewrite.internal.lang.Nullable; import java.util.*; import java.util.function.BiPredicate; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/MoveContentToFile.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/MoveContentToFile.java index bc3d3f28d47..e5d397d0a68 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/MoveContentToFile.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/MoveContentToFile.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.hcl.tree.BodyContent; import org.openrewrite.hcl.tree.Hcl; import org.openrewrite.hcl.tree.Space; -import org.openrewrite.internal.lang.Nullable; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/RandomizeIdVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/RandomizeIdVisitor.java index 18140b96a8a..992e476cc76 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/RandomizeIdVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/RandomizeIdVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.hcl; +import org.jspecify.annotations.Nullable; import org.openrewrite.hcl.tree.Hcl; -import org.openrewrite.internal.lang.Nullable; import static org.openrewrite.Tree.randomId; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AttributeSpaceVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AttributeSpaceVisitor.java index 075c62e875c..dc497dd9af1 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AttributeSpaceVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AttributeSpaceVisitor.java @@ -15,6 +15,7 @@ */ package org.openrewrite.hcl.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.hcl.HclIsoVisitor; import org.openrewrite.hcl.style.SpacesStyle; @@ -23,7 +24,6 @@ import org.openrewrite.hcl.tree.Hcl; import org.openrewrite.hcl.tree.HclLeftPadded; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.ArrayList; import java.util.Collections; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AutoFormatVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AutoFormatVisitor.java index cdbbd65e1df..2040b6fbbb1 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AutoFormatVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/AutoFormatVisitor.java @@ -15,6 +15,7 @@ */ package org.openrewrite.hcl.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; import org.openrewrite.hcl.HclVisitor; @@ -22,7 +23,6 @@ import org.openrewrite.hcl.style.SpacesStyle; import org.openrewrite.hcl.style.TabsAndIndentsStyle; import org.openrewrite.hcl.tree.Hcl; -import org.openrewrite.internal.lang.Nullable; import java.util.Optional; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BlankLinesVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BlankLinesVisitor.java index 46aa5a6ac5d..c8e9612e48e 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BlankLinesVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BlankLinesVisitor.java @@ -15,13 +15,13 @@ */ package org.openrewrite.hcl.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.hcl.HclIsoVisitor; import org.openrewrite.hcl.tree.Hcl; import org.openrewrite.hcl.tree.HclRightPadded; import org.openrewrite.hcl.tree.Space; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; public class BlankLinesVisitor

extends HclIsoVisitor

{ @Nullable diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BracketsVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BracketsVisitor.java index a88ad9efe8f..6bbd596c11e 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BracketsVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/BracketsVisitor.java @@ -15,12 +15,12 @@ */ package org.openrewrite.hcl.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.hcl.HclIsoVisitor; import org.openrewrite.hcl.style.BracketsStyle; import org.openrewrite.hcl.tree.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.ArrayList; import java.util.List; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/SpacesVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/SpacesVisitor.java index 52a934fee2a..6a6af6f6726 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/SpacesVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/SpacesVisitor.java @@ -15,12 +15,12 @@ */ package org.openrewrite.hcl.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.hcl.HclIsoVisitor; import org.openrewrite.hcl.style.SpacesStyle; import org.openrewrite.hcl.tree.Expression; import org.openrewrite.hcl.tree.Hcl; -import org.openrewrite.internal.lang.Nullable; public class SpacesVisitor

extends HclIsoVisitor

{ @Nullable diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/TabsAndIndentsVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/TabsAndIndentsVisitor.java index ad4a40ad88a..cbb9ea5d5c3 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/TabsAndIndentsVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/TabsAndIndentsVisitor.java @@ -15,6 +15,7 @@ */ package org.openrewrite.hcl.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; import org.openrewrite.hcl.HclIsoVisitor; @@ -22,7 +23,6 @@ import org.openrewrite.hcl.tree.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.Iterator; import java.util.List; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/package-info.java index 6a5c57df0ba..e29f2e2cdfd 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/format/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl.format; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java index 8d93f600305..c8c221a8ad6 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java @@ -19,12 +19,12 @@ import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.FileAttributes; import org.openrewrite.hcl.internal.grammar.HCLParser; import org.openrewrite.hcl.internal.grammar.HCLParserBaseVisitor; import org.openrewrite.hcl.tree.*; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.nio.charset.Charset; @@ -660,8 +660,8 @@ public Hcl visitVariableExpr(HCLParser.VariableExprContext ctx) { }); } - @NonNull - private Hcl.Identifier visitIdentifier(TerminalNode identifier) { + + private Hcl.@NonNull Identifier visitIdentifier(TerminalNode identifier) { Hcl.Identifier ident = new Hcl.Identifier(randomId(), Space.format(prefix(identifier)), Markers.EMPTY, identifier.getText()); skip(identifier); diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclPrinter.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclPrinter.java index 3fb0e786ce2..76bb09325a4 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclPrinter.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclPrinter.java @@ -15,11 +15,11 @@ */ package org.openrewrite.hcl.internal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.PrintOutputCapture; import org.openrewrite.hcl.HclVisitor; import org.openrewrite.hcl.tree.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Markers; @@ -402,7 +402,7 @@ private void beforeSyntax(Hcl h, Space.Location loc, PrintOutputCapture

p) { beforeSyntax(h.getPrefix(), h.getMarkers(), loc, p); } - private void beforeSyntax(Space prefix, Markers markers, @Nullable Space.Location loc, PrintOutputCapture

p) { + private void beforeSyntax(Space prefix, Markers markers, Space.@Nullable Location loc, PrintOutputCapture

p) { for (Marker marker : markers.getMarkers()) { p.append(p.getMarkerPrinter().beforePrefix(marker, new Cursor(getCursor(), marker), HCL_MARKER_WRAPPER)); } diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/package-info.java index 96f85883e9f..83ea49491af 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/Substitutions.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/Substitutions.java index c2504684d59..d981f383d6e 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/Substitutions.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/Substitutions.java @@ -16,11 +16,11 @@ package org.openrewrite.hcl.internal.template; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.hcl.HclVisitor; import org.openrewrite.hcl.tree.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/package-info.java index 9db10ebd859..8fe03064a9b 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/template/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl.internal.template; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/package-info.java index 9e94ec8d973..78b68b11616 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/FindAndReplaceLiteral.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/FindAndReplaceLiteral.java index 68e9798fb6f..98e7075adf4 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/FindAndReplaceLiteral.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/FindAndReplaceLiteral.java @@ -17,13 +17,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.hcl.HclIsoVisitor; import org.openrewrite.hcl.tree.Hcl; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.AlreadyReplaced; import java.util.Objects; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/package-info.java index ee2e3117dbb..3195e1d05e2 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/search/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/style/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/style/package-info.java index feba7fe1858..8ae18ce0a51 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/style/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/style/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl.style; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Hcl.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Hcl.java index 6c74120cc89..8ee49114969 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Hcl.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Hcl.java @@ -19,12 +19,12 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.hcl.HclParser; import org.openrewrite.hcl.HclVisitor; import org.openrewrite.hcl.internal.HclPrinter; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.template.SourceTemplate; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclContainer.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclContainer.java index f8b22a31461..e39239cca12 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclContainer.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclContainer.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.util.List; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclCoordinates.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclCoordinates.java index 6ac1f4e340c..5616b533f28 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclCoordinates.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclCoordinates.java @@ -18,7 +18,7 @@ import lombok.AccessLevel; import lombok.Data; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.template.Coordinates; import java.util.Comparator; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclLeftPadded.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclLeftPadded.java index f7eb7dfd4a1..ae3155813df 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclLeftPadded.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclLeftPadded.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.function.UnaryOperator; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclRightPadded.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclRightPadded.java index c51ff2d27ed..366b94a2300 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclRightPadded.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/HclRightPadded.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.ArrayList; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Space.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Space.java index e73b1b48e37..79a3a4737b8 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Space.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/Space.java @@ -19,8 +19,8 @@ import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.EqualsAndHashCode; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.util.*; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/package-info.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/package-info.java index 7985880512c..a023a136d9b 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/package-info.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/tree/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.hcl.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/Java11Parser.java b/rewrite-java-11/src/main/java/org/openrewrite/java/Java11Parser.java index 9379f79c04c..df8b5867f4e 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/Java11Parser.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/Java11Parser.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import java.lang.reflect.Constructor; diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java index c32b6b1e7b5..97a6c232ccd 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java @@ -29,9 +29,9 @@ import com.sun.tools.javac.tree.DCTree; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.LeadingBrace; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; @@ -678,7 +678,7 @@ public J visitReference(@Nullable ReferenceTree node, List body) { return qualifier; } - private @Nullable JavaType.Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { if (type instanceof JavaType.Class) { JavaType.Class classType = (JavaType.Class) type; @@ -734,7 +734,7 @@ private boolean paramTypeMatches(JavaType testParamType, Type paramType) { return false; } - private @Nullable JavaType.Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { JavaType.Class classType = TypeUtils.asClass(type); if (classType == null) { return null; diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11Parser.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11Parser.java index 12ef7468914..75a6e970757 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11Parser.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11Parser.java @@ -24,6 +24,8 @@ import com.sun.tools.javac.util.Options; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; @@ -32,8 +34,6 @@ import org.openrewrite.SourceFile; import org.openrewrite.internal.MetricsHelper; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNullApi; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaParsingException; import org.openrewrite.java.internal.JavaTypeCache; @@ -62,7 +62,7 @@ /** * This parser is NOT thread-safe, as the OpenJDK parser maintains in-memory caches in static state. */ -@NonNullApi +@NullMarked public class ReloadableJava11Parser implements JavaParser { private final JavaTypeCache typeCache; @@ -302,8 +302,8 @@ public void reset(Collection uris) { } private static class TimedTodo extends Todo { - @Nullable - private Timer.Sample sample; + + private Timer.@Nullable Sample sample; private TimedTodo(Context context) { super(context); diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserInputFileObject.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserInputFileObject.java index b08dc52f14a..589ba611c16 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserInputFileObject.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserInputFileObject.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import javax.lang.model.element.Modifier; diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java index eb7c94c0bfb..ec500c8326e 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java @@ -26,12 +26,12 @@ import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParsingException; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.OmitParentheses; diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java index 496dffe5df1..8b35189e5b5 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.*; import com.sun.tools.javac.tree.JCTree; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeMapping; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.tree.Flag; @@ -396,12 +396,12 @@ public JavaType.Primitive primitive(TypeTag tag) { } } - public @Nullable JavaType.Variable variableType(@Nullable Symbol symbol) { + public JavaType.@Nullable Variable variableType(@Nullable Symbol symbol) { return variableType(symbol, null); } - private @Nullable JavaType.Variable variableType(@Nullable Symbol symbol, - @Nullable JavaType.FullyQualified owner) { + private JavaType.@Nullable Variable variableType(@Nullable Symbol symbol, + JavaType.@Nullable FullyQualified owner) { if (!(symbol instanceof Symbol.VarSymbol)) { return null; } @@ -447,7 +447,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public @Nullable JavaType.Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.Kind.ERR || symbol.type instanceof Type.UnknownType) { return null; } @@ -547,7 +547,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param declaringType The method's declaring type. * @return Method type attribution. */ - public @Nullable JavaType.Method methodDeclarationType(@Nullable Symbol symbol, @Nullable JavaType.FullyQualified declaringType) { + public JavaType.@Nullable Method methodDeclarationType(@Nullable Symbol symbol, JavaType.@Nullable FullyQualified declaringType) { // if the symbol is not a method symbol, there is a parser error in play Symbol.MethodSymbol methodSymbol = symbol instanceof Symbol.MethodSymbol ? (Symbol.MethodSymbol) symbol : null; diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java index 358cec45bea..612ce245244 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeSignatureBuilder.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; import com.sun.tools.javac.tree.JCTree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/Java17Parser.java b/rewrite-java-17/src/main/java/org/openrewrite/java/Java17Parser.java index 3bbc9047351..0bf416885c5 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/Java17Parser.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/Java17Parser.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import java.lang.reflect.Constructor; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java index 8ebec86b88e..96bff715540 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java @@ -32,9 +32,9 @@ import com.sun.tools.javac.tree.DCTree; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.LeadingBrace; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; @@ -681,7 +681,7 @@ public J visitReference(@Nullable ReferenceTree node, List body) { return qualifier; } - private @Nullable JavaType.Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { if (type instanceof JavaType.Class) { JavaType.Class classType = (JavaType.Class) type; @@ -737,7 +737,7 @@ private boolean paramTypeMatches(JavaType testParamType, Type paramType) { return false; } - private @Nullable JavaType.Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { JavaType.Class classType = TypeUtils.asClass(type); if (classType == null) { return null; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17Parser.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17Parser.java index f05e0be180f..100e3763102 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17Parser.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17Parser.java @@ -25,6 +25,8 @@ import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.Options; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; @@ -32,8 +34,6 @@ import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNullApi; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaParsingException; import org.openrewrite.java.internal.JavaTypeCache; @@ -62,7 +62,7 @@ /** * This parser is NOT thread-safe, as the OpenJDK parser maintains in-memory caches in static state. */ -@NonNullApi +@NullMarked public class ReloadableJava17Parser implements JavaParser { private final JavaTypeCache typeCache; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserInputFileObject.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserInputFileObject.java index a80aeab635b..6708943d17b 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserInputFileObject.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserInputFileObject.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import javax.lang.model.element.Modifier; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java index b98eb15e949..64fff05cdb2 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java @@ -26,12 +26,12 @@ import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParsingException; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.CompactConstructor; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java index 825dd970522..74af1f8a7d6 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.*; import com.sun.tools.javac.tree.JCTree; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeMapping; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.tree.Flag; @@ -395,12 +395,12 @@ public JavaType.Primitive primitive(TypeTag tag) { } } - public @Nullable JavaType.Variable variableType(@Nullable Symbol symbol) { + public JavaType.@Nullable Variable variableType(@Nullable Symbol symbol) { return variableType(symbol, null); } - private @Nullable JavaType.Variable variableType(@Nullable Symbol symbol, - @Nullable JavaType.FullyQualified owner) { + private JavaType.@Nullable Variable variableType(@Nullable Symbol symbol, + JavaType.@Nullable FullyQualified owner) { if (!(symbol instanceof Symbol.VarSymbol)) { return null; } @@ -446,7 +446,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public @Nullable JavaType.Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.Kind.ERR || symbol.type instanceof Type.UnknownType) { return null; } @@ -548,7 +548,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param declaringType The method's declaring type. * @return Method type attribution. */ - public @Nullable JavaType.Method methodDeclarationType(@Nullable Symbol symbol, @Nullable JavaType.FullyQualified declaringType) { + public JavaType.@Nullable Method methodDeclarationType(@Nullable Symbol symbol, JavaType.@Nullable FullyQualified declaringType) { // if the symbol is not a method symbol, there is a parser error in play Symbol.MethodSymbol methodSymbol = symbol instanceof Symbol.MethodSymbol ? (Symbol.MethodSymbol) symbol : null; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java index f72e556e13a..7e287e11ab4 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeSignatureBuilder.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; import com.sun.tools.javac.tree.JCTree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/package-info.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/package-info.java index 3cb0cef3635..d57915e1ce6 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/package-info.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.isolated; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/Java21Parser.java b/rewrite-java-21/src/main/java/org/openrewrite/java/Java21Parser.java index 04fa6a90875..fe61f00d449 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/Java21Parser.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/Java21Parser.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import java.lang.reflect.Constructor; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java index 57cbeacd062..99d15a63af9 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java @@ -32,9 +32,9 @@ import com.sun.tools.javac.tree.DCTree; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.LeadingBrace; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; @@ -681,7 +681,7 @@ public J visitReference(@Nullable ReferenceTree node, List body) { return qualifier; } - private @Nullable JavaType.Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { if (type instanceof JavaType.Class) { JavaType.Class classType = (JavaType.Class) type; @@ -737,7 +737,7 @@ private boolean paramTypeMatches(JavaType testParamType, Type paramType) { return false; } - private @Nullable JavaType.Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { JavaType.Class classType = TypeUtils.asClass(type); if (classType == null) { return null; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21Parser.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21Parser.java index ba712d44646..2fda7bc1e06 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21Parser.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21Parser.java @@ -25,6 +25,8 @@ import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Log; import com.sun.tools.javac.util.Options; +import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; @@ -32,8 +34,6 @@ import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNullApi; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaParsingException; import org.openrewrite.java.internal.JavaTypeCache; @@ -62,7 +62,7 @@ /** * This parser is NOT thread-safe, as the OpenJDK parser maintains in-memory caches in static state. */ -@NonNullApi +@NullMarked public class ReloadableJava21Parser implements JavaParser { private final JavaTypeCache typeCache; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserInputFileObject.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserInputFileObject.java index 3eb5fea422a..2c7def892da 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserInputFileObject.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserInputFileObject.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import javax.lang.model.element.Modifier; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java index cfb90bd1378..6cc08b4e0bc 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java @@ -26,12 +26,12 @@ import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParsingException; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.CompactConstructor; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java index 20ef8c85a1e..afb488cc499 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.*; import com.sun.tools.javac.tree.JCTree; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeMapping; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.tree.Flag; @@ -413,12 +413,12 @@ public JavaType.Primitive primitive(TypeTag tag) { } } - public @Nullable JavaType.Variable variableType(@Nullable Symbol symbol) { + public JavaType.@Nullable Variable variableType(@Nullable Symbol symbol) { return variableType(symbol, null); } - private @Nullable JavaType.Variable variableType(@Nullable Symbol symbol, - @Nullable JavaType.FullyQualified owner) { + private JavaType.@Nullable Variable variableType(@Nullable Symbol symbol, + JavaType.@Nullable FullyQualified owner) { if (!(symbol instanceof Symbol.VarSymbol)) { return null; } @@ -464,7 +464,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public @Nullable JavaType.Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.Kind.ERR || symbol.type instanceof Type.UnknownType) { return null; } @@ -566,7 +566,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param declaringType The method's declaring type. * @return Method type attribution. */ - public @Nullable JavaType.Method methodDeclarationType(@Nullable Symbol symbol, @Nullable JavaType.FullyQualified declaringType) { + public JavaType.@Nullable Method methodDeclarationType(@Nullable Symbol symbol, JavaType.@Nullable FullyQualified declaringType) { // if the symbol is not a method symbol, there is a parser error in play Symbol.MethodSymbol methodSymbol = symbol instanceof Symbol.MethodSymbol ? (Symbol.MethodSymbol) symbol : null; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java index 4854eef8a2f..172a58c674e 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeSignatureBuilder.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; import com.sun.tools.javac.tree.JCTree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/package-info.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/package-info.java index dfc8b441031..d8d39497d55 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/package-info.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.isolated; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/Java8Parser.java b/rewrite-java-8/src/main/java/org/openrewrite/java/Java8Parser.java index 3abd32b3bd7..9e68f2bd47a 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/Java8Parser.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/Java8Parser.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import java.io.File; diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/Java8ParserInputFileObject.java b/rewrite-java-8/src/main/java/org/openrewrite/java/Java8ParserInputFileObject.java index 18632b4e842..6b8758f165e 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/Java8ParserInputFileObject.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/Java8ParserInputFileObject.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; -import org.openrewrite.internal.lang.Nullable; import javax.lang.model.element.Modifier; import javax.lang.model.element.NestingKind; diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java index 7a44272d981..c3d34d2fcdc 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java @@ -29,9 +29,9 @@ import com.sun.tools.javac.tree.DCTree; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.LeadingBrace; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; @@ -49,8 +49,8 @@ public class ReloadableJava8JavadocVisitor extends DocTreeScanner> { private final Attr attr; - @Nullable - private final Symbol.TypeSymbol symbol; + + private final Symbol.@Nullable TypeSymbol symbol; @Nullable private final Type enclosingClassType; @@ -638,7 +638,7 @@ public J visitReference(@Nullable ReferenceTree node, List body) { return qualifier; } - private @Nullable JavaType.Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Method methodReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { JavaType.Class classType = TypeUtils.asClass(type); if (classType == null) { return null; @@ -688,7 +688,7 @@ private boolean paramTypeMatches(JavaType testParamType, Type paramType) { return false; } - private @Nullable JavaType.Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { + private JavaType.@Nullable Variable fieldReferenceType(DCTree.DCReference ref, @Nullable JavaType type) { JavaType.Class classType = TypeUtils.asClass(type); if (classType == null) { return null; diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8Parser.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8Parser.java index 915f4628228..227b6f3609c 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8Parser.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8Parser.java @@ -24,6 +24,7 @@ import com.sun.tools.javac.util.Options; import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.Opcodes; @@ -32,7 +33,6 @@ import org.openrewrite.SourceFile; import org.openrewrite.internal.MetricsHelper; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; @@ -263,7 +263,7 @@ public void reset(Collection uris) { private static class TimedTodo extends Todo { private final Todo todo; - private @Nullable Timer.Sample sample; + private Timer.@Nullable Sample sample; private TimedTodo(Todo todo) { super(new Context()); diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8ParserVisitor.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8ParserVisitor.java index f960996a2da..a871d79ceb3 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8ParserVisitor.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8ParserVisitor.java @@ -25,12 +25,12 @@ import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.*; import com.sun.tools.javac.util.Context; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.OmitParentheses; import org.openrewrite.java.tree.*; @@ -2055,7 +2055,7 @@ private List collectAnnotations(Map annotat return annotations; } - Space formatWithCommentTree(String prefix, JCTree tree, @Nullable DCTree.DCDocComment commentTree) { + Space formatWithCommentTree(String prefix, JCTree tree, DCTree.@Nullable DCDocComment commentTree) { Space fmt = format(prefix); if (commentTree != null) { List comments = fmt.getComments(); diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java index 16b348f7253..9e39d0cc5c2 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.*; import com.sun.tools.javac.tree.JCTree; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.tree.Flag; import org.openrewrite.java.tree.JavaType; @@ -396,12 +396,12 @@ public JavaType.Primitive primitive(TypeTag tag) { } } - public @Nullable JavaType.Variable variableType(@Nullable Symbol symbol) { + public JavaType.@Nullable Variable variableType(@Nullable Symbol symbol) { return variableType(symbol, null); } - private @Nullable JavaType.Variable variableType(@Nullable Symbol symbol, - @Nullable JavaType.FullyQualified owner) { + private JavaType.@Nullable Variable variableType(@Nullable Symbol symbol, + JavaType.@Nullable FullyQualified owner) { if (!(symbol instanceof Symbol.VarSymbol)) { return null; } @@ -447,7 +447,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public @Nullable JavaType.Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.ERR || symbol.type instanceof Type.UnknownType) { return null; } @@ -547,7 +547,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param declaringType The method's declaring type. * @return Method type attribution. */ - public @Nullable JavaType.Method methodDeclarationType(@Nullable Symbol symbol, @Nullable JavaType.FullyQualified declaringType) { + public JavaType.@Nullable Method methodDeclarationType(@Nullable Symbol symbol, JavaType.@Nullable FullyQualified declaringType) { // if the symbol is not a method symbol, there is a parser error in play Symbol.MethodSymbol methodSymbol = symbol instanceof Symbol.MethodSymbol ? (Symbol.MethodSymbol) symbol : null; diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java index 96f7f6fe008..3a608b88496 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeSignatureBuilder.java @@ -19,7 +19,7 @@ import com.sun.tools.javac.code.Type; import com.sun.tools.javac.code.TypeTag; import com.sun.tools.javac.tree.JCTree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.JavaType; import javax.lang.model.type.NullType; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/RepeatTest.java b/rewrite-java-test/src/test/java/org/openrewrite/RepeatTest.java index 35eca0f67e3..b905e7613e4 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/RepeatTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/RepeatTest.java @@ -15,9 +15,9 @@ */ package org.openrewrite; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.internal.RecipeRunException; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/AddImportTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/AddImportTest.java index 9a1728a7518..e5b6c404e5f 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/AddImportTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/AddImportTest.java @@ -15,12 +15,12 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.ExecutionContext; import org.openrewrite.Issue; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.style.ImportLayoutStyle; import org.openrewrite.java.tree.J; import org.openrewrite.style.NamedStyles; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java index bcf80c67032..92f68bc6eaa 100755 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/JavaTemplateInstanceOfTest.java @@ -16,11 +16,11 @@ package org.openrewrite.java; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junitpioneer.jupiter.ExpectedToFail; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.FindMissingTypes; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/ReplaceStringLiteralWithConstantTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/ReplaceStringLiteralWithConstantTest.java index 70930ae4811..9632cf74a08 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/ReplaceStringLiteralWithConstantTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/ReplaceStringLiteralWithConstantTest.java @@ -15,11 +15,11 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.ExecutionContext; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/UpdateSourcePositionsTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/UpdateSourcePositionsTest.java index 0e0842f7eeb..151984ee81f 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/UpdateSourcePositionsTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/UpdateSourcePositionsTest.java @@ -15,10 +15,10 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.*; import org.openrewrite.internal.InMemoryLargeSourceSet; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Range; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFileTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFileTest.java index 634446318d3..7bcc37b614f 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFileTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFileTest.java @@ -15,10 +15,10 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.Issue; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.style.NamedStyles; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/package-info.java b/rewrite-java-test/src/test/java/org/openrewrite/java/package-info.java index 1ee076b2785..e697a3e66c4 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/package-info.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java-test/src/test/java/org/openrewrite/java/search/IsOrIsNotLikelyTestTest.java b/rewrite-java-test/src/test/java/org/openrewrite/java/search/IsOrIsNotLikelyTestTest.java index 92fed7c6cad..5fc6eefbe0d 100644 --- a/rewrite-java-test/src/test/java/org/openrewrite/java/search/IsOrIsNotLikelyTestTest.java +++ b/rewrite-java-test/src/test/java/org/openrewrite/java/search/IsOrIsNotLikelyTestTest.java @@ -16,13 +16,13 @@ package org.openrewrite.java.search; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.marker.SearchResult; import org.openrewrite.test.RecipeSpec; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddImport.java b/rewrite-java/src/main/java/org/openrewrite/java/AddImport.java index 7a7ca03c0b2..3feff736d1c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddImport.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddImport.java @@ -16,11 +16,11 @@ package org.openrewrite.java; import lombok.EqualsAndHashCode; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.search.FindMethods; import org.openrewrite.java.search.FindTypes; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java b/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java index 6a07c3cf66a..111099d9ab4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddLicenseHeader.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; import org.openrewrite.java.tree.TextComment; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddLiteralMethodArgument.java b/rewrite-java/src/main/java/org/openrewrite/java/AddLiteralMethodArgument.java index a9b72ab69c0..5e6ee2c048a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddLiteralMethodArgument.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddLiteralMethodArgument.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.apache.commons.lang3.StringUtils; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddNullMethodArgument.java b/rewrite-java/src/main/java/org/openrewrite/java/AddNullMethodArgument.java index 745373d7ba6..2d9af6882b9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddNullMethodArgument.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddNullMethodArgument.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java b/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java index aba2d59d588..b871f126b3d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AddOrUpdateAnnotationAttribute.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesType; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/AnnotationMatcher.java b/rewrite-java/src/main/java/org/openrewrite/java/AnnotationMatcher.java index 0cf54ccde7c..e37d088fe21 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/AnnotationMatcher.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/AnnotationMatcher.java @@ -17,8 +17,8 @@ import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.grammar.AnnotationSignatureLexer; import org.openrewrite.java.internal.grammar.AnnotationSignatureParser; import org.openrewrite.java.tree.Expression; @@ -84,11 +84,11 @@ private boolean matchesAnnotationName(J.Annotation annotation) { return matchesAnnotationOrMetaAnnotation(TypeUtils.asFullyQualified(annotation.getType()), null); } - public boolean matchesAnnotationOrMetaAnnotation(@Nullable JavaType.FullyQualified fqn) { + public boolean matchesAnnotationOrMetaAnnotation(JavaType.@Nullable FullyQualified fqn) { return matchesAnnotationOrMetaAnnotation(fqn, null); } - private boolean matchesAnnotationOrMetaAnnotation(@Nullable JavaType.FullyQualified fqn, + private boolean matchesAnnotationOrMetaAnnotation(JavaType.@Nullable FullyQualified fqn, @Nullable Set seenAnnotations) { if (fqn != null) { if (matcher.matcher(fqn.getFullyQualifiedName()).matches()) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/Assertions.java b/rewrite-java/src/main/java/org/openrewrite/java/Assertions.java index b84444d43fe..d32a50a1ed9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/Assertions.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/Assertions.java @@ -16,11 +16,11 @@ package org.openrewrite.java; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.JavaProject; import org.openrewrite.java.marker.JavaSourceSet; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeFieldName.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeFieldName.java index 84b4e943d08..1cc8bfefc10 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeFieldName.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeFieldName.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JLeftPadded; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevel.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevel.java index 10ecc850b72..09cbfbd76e8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevel.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevel.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.DeclaresMethod; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevelVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevelVisitor.java index 37ebb0fecb0..6cc3c3f4672 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevelVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodAccessLevelVisitor.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.Comment; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; @@ -38,8 +38,7 @@ public class ChangeMethodAccessLevelVisitor

extends JavaIsoVisitor

{ MethodMatcher methodMatcher; - @Nullable - J.Modifier.Type newAccessLevel; + J.Modifier.@Nullable Type newAccessLevel; @Override public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, P p) { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java index fc414e2ac25..29206f0843a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodName.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.DeclaresMethod; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToStatic.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToStatic.java index 7def157c889..086cc23b9af 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToStatic.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToStatic.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToVariable.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToVariable.java index 4dbf501fa0a..d3966162aac 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToVariable.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeMethodTargetToVariable.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.Flag; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java index f1a9f724d5d..3977032dafa 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangePackage.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.*; import org.openrewrite.marker.SearchResult; @@ -307,7 +307,7 @@ public J postVisit(J tree, ExecutionContext ctx) { return oldType; } - private @Nullable JavaType.Method updateType(@Nullable JavaType.Method oldMethodType) { + private JavaType.@Nullable Method updateType(JavaType.@Nullable Method oldMethodType) { if (oldMethodType != null) { JavaType.Method method = (JavaType.Method) oldNameToChangedType.get(oldMethodType); if (method != null) { @@ -330,7 +330,7 @@ private String getNewPackageName(String packageName) { newPackageName + packageName.substring(oldPackageName.length()) : newPackageName; } - private boolean isTargetFullyQualifiedType(@Nullable JavaType.FullyQualified fq) { + private boolean isTargetFullyQualifiedType(JavaType.@Nullable FullyQualified fq) { return fq != null && (fq.getPackageName().equals(oldPackageName) && !fq.getClassName().isEmpty() || isTargetRecursivePackageName(fq.getPackageName())); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java index 9152f8a45f6..7f83e218494 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java @@ -19,9 +19,9 @@ import lombok.Value; import org.apache.commons.lang3.StringUtils; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesField; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java index 8ab0b990d3e..f6a009a5524 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeType.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesType; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; @@ -100,8 +100,8 @@ private static class ChangeTypeVisitor extends JavaVisitor { private final JavaType.Class originalType; private final JavaType targetType; - @Nullable - private J.Identifier importAlias; + + private J.@Nullable Identifier importAlias; @Nullable private final Boolean ignoreDefinition; @@ -484,7 +484,7 @@ private Expression updateOuterClassTypes(Expression typeTree) { return oldType; } - private @Nullable JavaType.Method updateType(@Nullable JavaType.Method oldMethodType) { + private JavaType.@Nullable Method updateType(JavaType.@Nullable Method oldMethodType) { if (oldMethodType != null) { JavaType.Method method = (JavaType.Method) oldNameToChangedType.get(oldMethodType); if (method != null) { @@ -502,7 +502,7 @@ private Expression updateOuterClassTypes(Expression typeTree) { return null; } - private boolean isTargetFullyQualifiedType(@Nullable JavaType.FullyQualified fq) { + private boolean isTargetFullyQualifiedType(JavaType.@Nullable FullyQualified fq) { return fq != null && TypeUtils.isOfClassType(fq, originalType.getFullyQualifiedName()) && targetType instanceof JavaType.FullyQualified; } } @@ -632,7 +632,7 @@ private JavaType updateType(@Nullable JavaType oldType) { return oldType; } - private @Nullable JavaType.Method updateType(@Nullable JavaType.Method mt) { + private JavaType.@Nullable Method updateType(JavaType.@Nullable Method mt) { if (mt != null) { return mt.withDeclaringType((JavaType.FullyQualified) updateType(mt.getDeclaringType())) .withReturnType(updateType(mt.getReturnType())) @@ -641,7 +641,7 @@ private JavaType updateType(@Nullable JavaType oldType) { return null; } - private boolean isTargetFullyQualifiedType(@Nullable JavaType.FullyQualified fq) { + private boolean isTargetFullyQualifiedType(JavaType.@Nullable FullyQualified fq) { return fq != null && TypeUtils.isOfClassType(fq, originalType.getFullyQualifiedName()); } } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/CountLinesVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/CountLinesVisitor.java index b9fadf59e1f..076e2e94831 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/CountLinesVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/CountLinesVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; import org.openrewrite.java.tree.Space; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java b/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java index dc64c29f428..030930c789e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/CreateEmptyJavaClass.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import java.nio.file.Path; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/DeleteStatement.java b/rewrite-java/src/main/java/org/openrewrite/java/DeleteStatement.java index 74d41ff7853..b87778759ee 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/DeleteStatement.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/DeleteStatement.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.FindReferencedTypes; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ImplementInterface.java b/rewrite-java/src/main/java/org/openrewrite/java/ImplementInterface.java index 01b0eb344f0..4423eea4bb9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ImplementInterface.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ImplementInterface.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/InvertCondition.java b/rewrite-java/src/main/java/org/openrewrite/java/InvertCondition.java index ed89e0a2b45..76d09aa8980 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/InvertCondition.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/InvertCondition.java @@ -15,11 +15,11 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.cleanup.SimplifyBooleanExpressionVisitor; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java index b3df6b61cd7..1de5c3195f7 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaParser.java @@ -20,8 +20,8 @@ import io.github.classgraph.ResourceList; import io.github.classgraph.ScanResult; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java index a8ec988c14a..3143e8d6d90 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.PrintOutputCapture; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.CompactConstructor; import org.openrewrite.java.marker.OmitParentheses; import org.openrewrite.java.tree.*; @@ -1202,7 +1202,7 @@ protected void beforeSyntax(J j, Space.Location loc, PrintOutputCapture

p) { } @SuppressWarnings("ForLoopReplaceableByForEach") - protected void beforeSyntax(Space prefix, Markers markers, @Nullable Space.Location loc, PrintOutputCapture

p) { + protected void beforeSyntax(Space prefix, Markers markers, Space.@Nullable Location loc, PrintOutputCapture

p) { List markersList = markers.getMarkers(); for (int i = 0; i < markersList.size(); i++) { Marker marker = markersList.get(i); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplate.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplate.java index 3c0214ad7d7..55e5eeb71a0 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplate.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplate.java @@ -18,10 +18,10 @@ import lombok.Getter; import lombok.Value; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Incubating; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.template.JavaTemplateJavaExtension; import org.openrewrite.java.internal.template.JavaTemplateParser; import org.openrewrite.java.internal.template.Substitutions; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplateSemanticallyEqual.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplateSemanticallyEqual.java index a8b45f91af3..2215355e8ce 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplateSemanticallyEqual.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaTemplateSemanticallyEqual.java @@ -17,9 +17,9 @@ import lombok.Value; import org.antlr.v4.runtime.*; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.grammar.TemplateParameterLexer; import org.openrewrite.java.internal.grammar.TemplateParameterParser; import org.openrewrite.java.internal.grammar.TemplateParameterParser.TypedPatternContext; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeMapping.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeMapping.java index 5701fe4e59e..678bbc85c23 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeMapping.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeMapping.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.JavaType; public interface JavaTypeMapping { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java index 3e351fa5203..c27e1a3cf1f 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeSignatureBuilder.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * In addition to the signature formats described below, implementations should provide a way of retrieving method diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeVisitor.java index d33f27ef6fa..7844bfa2f66 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaTypeVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.JavaType; import java.util.List; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaUnrestrictedClassLoader.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaUnrestrictedClassLoader.java index 094746873d2..9d1ac908dcc 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaUnrestrictedClassLoader.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaUnrestrictedClassLoader.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.ByteArrayOutputStream; import java.io.IOException; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaVisitor.java index 22686c66c9b..40178ed54d6 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.service.AutoFormatService; import org.openrewrite.java.service.ImportService; import org.openrewrite.java.tree.*; @@ -57,7 +57,7 @@ protected JavadocVisitor

getJavadocVisitor() { * * @param clazz The class that will be imported into the compilation unit. */ - public void maybeAddImport(@Nullable JavaType.FullyQualified clazz) { + public void maybeAddImport(JavaType.@Nullable FullyQualified clazz) { if (clazz != null) { maybeAddImport(clazz.getFullyQualifiedName()); } @@ -155,7 +155,7 @@ public S service(Class service) { throw new IllegalArgumentException("No JavaSourceFile parent found"); } - public void maybeRemoveImport(@Nullable JavaType.FullyQualified clazz) { + public void maybeRemoveImport(JavaType.@Nullable FullyQualified clazz) { if (clazz != null) { maybeRemoveImport(clazz.getFullyQualifiedName()); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavadocPrinter.java b/rewrite-java/src/main/java/org/openrewrite/java/JavadocPrinter.java index 2bfe7daa235..01c35f7a801 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavadocPrinter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavadocPrinter.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.PrintOutputCapture; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.LeadingBrace; import org.openrewrite.java.tree.*; import org.openrewrite.marker.Marker; @@ -518,7 +518,7 @@ private void beforeSyntax(J j, Space.Location loc, PrintOutputCapture

p) { beforeSyntax(j.getPrefix(), j.getMarkers(), loc, p); } - private void beforeSyntax(Space prefix, Markers markers, @Nullable Space.Location loc, PrintOutputCapture

p) { + private void beforeSyntax(Space prefix, Markers markers, Space.@Nullable Location loc, PrintOutputCapture

p) { for (Marker marker : markers.getMarkers()) { p.append(p.getMarkerPrinter().beforePrefix(marker, new Cursor(getCursor(), marker), JAVADOC_MARKER_WRAPPER)); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavadocVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/JavadocVisitor.java index 55936cd1ba6..f531648306c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavadocVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavadocVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Javadoc; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/MethodMatcher.java b/rewrite-java/src/main/java/org/openrewrite/java/MethodMatcher.java index 1379246b65d..13e4d1df042 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/MethodMatcher.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/MethodMatcher.java @@ -21,8 +21,8 @@ import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.grammar.MethodSignatureLexer; import org.openrewrite.java.internal.grammar.MethodSignatureParser; import org.openrewrite.java.internal.grammar.MethodSignatureParserBaseVisitor; @@ -184,7 +184,7 @@ private boolean matchesTargetTypeName(String fullyQualifiedTypeName) { this.targetTypePattern != null && this.targetTypePattern.matcher(fullyQualifiedTypeName).matches(); } - boolean matchesTargetType(@Nullable JavaType.FullyQualified type) { + boolean matchesTargetType(JavaType.@Nullable FullyQualified type) { return TypeUtils.isOfTypeWithName( type, matchOverrides, @@ -215,7 +215,7 @@ private boolean matchesParameterTypes(List parameterTypes) { return argumentPattern.matcher(joiner.toString()).matches(); } - public boolean matches(@Nullable JavaType.Method type) { + public boolean matches(JavaType.@Nullable Method type) { if (type == null) { return false; } @@ -316,7 +316,7 @@ public boolean matches(J.MethodDeclaration method, J.NewClass enclosing) { * Using matchUnknownTypes can improve Visitor resiliency for an AST with missing type information, but * also increases the risk of false-positive matches on unrelated MethodInvocation instances. */ - public boolean matches(@Nullable J.MethodInvocation method, boolean matchUnknownTypes) { + public boolean matches(J.@Nullable MethodInvocation method, boolean matchUnknownTypes) { if (method == null) { return false; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/NoMissingTypes.java b/rewrite-java/src/main/java/org/openrewrite/java/NoMissingTypes.java index e4e21334d7d..146fc4abef4 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/NoMissingTypes.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/NoMissingTypes.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.FindMissingTypes; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/OrderImports.java b/rewrite-java/src/main/java/org/openrewrite/java/OrderImports.java index 107f843fc26..bfbc000cf6c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/OrderImports.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/OrderImports.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.FormatFirstClassPrefix; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.style.ImportLayoutStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RandomizeIdVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/RandomizeIdVisitor.java index a783a5d1489..9c7984d38d8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/RandomizeIdVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RandomizeIdVisitor.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.J; import static org.openrewrite.Tree.randomId; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RecipeMarkupDemonstration.java b/rewrite-java/src/main/java/org/openrewrite/java/RecipeMarkupDemonstration.java index 8873571f010..93b1314c725 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/RecipeMarkupDemonstration.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RecipeMarkupDemonstration.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markup; import static java.util.Objects.requireNonNull; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java index 2c58ad3c6a1..ecba536f14b 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.NonNull; import org.openrewrite.ExecutionContext; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.NonNull; import org.openrewrite.java.tree.*; import java.util.ArrayList; @@ -141,7 +141,7 @@ private List removeAnnotationOrEmpty(List leadingAnn * * @param annotation the annotation to check */ - private void maybeRemoveAnnotationParameterImports(@NonNull J.Annotation annotation) { + private void maybeRemoveAnnotationParameterImports(J.@NonNull Annotation annotation) { if (ListUtils.nullIfEmpty(annotation.getArguments()) == null) { return; } @@ -174,14 +174,14 @@ private void maybeRemoveImportFromExpression(Expression expression) { } } - private void maybeRemoveAnnotationFromArray(@NonNull J.NewArray newArray) { + private void maybeRemoveAnnotationFromArray(J.@NonNull NewArray newArray) { List initializer = newArray.getInitializer(); if (ListUtils.nullIfEmpty(initializer) != null) { initializer.forEach(this::maybeRemoveImportFromExpression); } } - private void maybeRemoveAnnotationFromFieldAccess(@NonNull J.FieldAccess fa) { + private void maybeRemoveAnnotationFromFieldAccess(J.@NonNull FieldAccess fa) { JavaType.Variable fieldType = fa.getName().getFieldType(); if (fieldType != null && fieldType.getOwner() != null) { maybeRemoveImport(TypeUtils.asFullyQualified(fieldType.getOwner())); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java b/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java index ff919cca6ba..75ea2452938 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RemoveImplements.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.service.AnnotationService; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RemoveImport.java b/rewrite-java/src/main/java/org/openrewrite/java/RemoveImport.java index b510e06872d..b0a33af0dfc 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/RemoveImport.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RemoveImport.java @@ -17,9 +17,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.FormatFirstClassPrefix; import org.openrewrite.java.style.ImportLayoutStyle; import org.openrewrite.java.style.IntelliJ; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RenameVariable.java b/rewrite-java/src/main/java/org/openrewrite/java/RenameVariable.java index 5cfef32c89b..eebbe73fcc2 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/RenameVariable.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RenameVariable.java @@ -16,11 +16,11 @@ package org.openrewrite.java; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.Tree; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.cleanup.RenameJavaDocParamNameVisitor; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java index a13bf2fb8e9..ab1432ef699 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.DeclaresMethod; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceAnnotation.java b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceAnnotation.java index 06fd9972c03..c221bd12fc7 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceAnnotation.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceAnnotation.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.service.ImportService; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaCoordinates; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java index 0f5b6f9ef4a..eedef216d95 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstant.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaType; import org.openrewrite.java.tree.TypeUtils; @@ -54,8 +54,7 @@ public String getDescription() { @Override public TreeVisitor getVisitor() { return new JavaVisitor() { - @Nullable - J.Literal literal; + J.@Nullable Literal literal; @Override public J visitFieldAccess(J.FieldAccess fieldAccess, ExecutionContext ctx) { @@ -75,7 +74,7 @@ public J visitIdentifier(J.Identifier ident, ExecutionContext ctx) { return super.visitIdentifier(ident, ctx); } - private boolean isConstant(@Nullable JavaType.Variable varType) { + private boolean isConstant(JavaType.@Nullable Variable varType) { return varType != null && TypeUtils.isOfClassType(varType.getOwner(), owningType) && varType.getName().equals(constantName); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstantWithAnotherConstant.java b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstantWithAnotherConstant.java index 52e0f7c3143..5390e813d37 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstantWithAnotherConstant.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceConstantWithAnotherConstant.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesType; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; @@ -121,7 +121,7 @@ private J replaceFieldAccess(Expression expression, JavaType.Variable fieldType) return expression; } - private boolean isConstant(@Nullable JavaType.Variable varType) { + private boolean isConstant(JavaType.@Nullable Variable varType) { return varType != null && TypeUtils.isOfClassType(varType.getOwner(), existingOwningType) && varType.getName().equals(constantName); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java index bb5c8c2bcd4..0bf40c51ba9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReplaceStringLiteralWithConstant.java @@ -19,9 +19,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.TypeUtils; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java b/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java index 37b42b728a1..d8907ed52c9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java @@ -15,10 +15,10 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.DefaultJavaTypeSignatureBuilder; import org.openrewrite.java.service.ImportService; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/SimplifyMethodChain.java b/rewrite-java/src/main/java/org/openrewrite/java/SimplifyMethodChain.java index e09c21fc8ed..d31f17ade7d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/SimplifyMethodChain.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/SimplifyMethodChain.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/TreeVisitingPrinter.java b/rewrite-java/src/main/java/org/openrewrite/java/TreeVisitingPrinter.java index 7f086a0522e..1ec21a30afe 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/TreeVisitingPrinter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/TreeVisitingPrinter.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.*; import java.util.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/TypeMatcher.java b/rewrite-java/src/main/java/org/openrewrite/java/TypeMatcher.java index da7ffd20dbd..ccf680c01fc 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/TypeMatcher.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/TypeMatcher.java @@ -18,8 +18,8 @@ import lombok.Getter; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.grammar.MethodSignatureLexer; import org.openrewrite.java.internal.grammar.MethodSignatureParser; import org.openrewrite.java.internal.grammar.MethodSignatureParserBaseVisitor; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/UnsafeReplaceJavaType.java b/rewrite-java/src/main/java/org/openrewrite/java/UnsafeReplaceJavaType.java index edf8564dbab..9ecf276a8bd 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/UnsafeReplaceJavaType.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/UnsafeReplaceJavaType.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Incubating; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.JavaType; import java.util.Collections; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/UpdateSourcePositions.java b/rewrite-java/src/main/java/org/openrewrite/java/UpdateSourcePositions.java index 55978f1d00d..bce4b03352e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/UpdateSourcePositions.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/UpdateSourcePositions.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; import org.openrewrite.marker.Range; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java b/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java index a094359febc..214c2df8010 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/UseStaticImport.java @@ -17,8 +17,8 @@ import lombok.*; import lombok.experimental.FieldDefaults; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.DeclaresMethod; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.Flag; @@ -146,7 +146,7 @@ private static boolean methodNameConflicts(String methodName, Cursor cursor) { return methodNameConflicts(methodName, cdCursor); } - private static boolean methodNameConflicts(String methodName, @Nullable JavaType.FullyQualified ct) { + private static boolean methodNameConflicts(String methodName, JavaType.@Nullable FullyQualified ct) { if(ct == null) { return false; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/VariableNameUtils.java b/rewrite-java/src/main/java/org/openrewrite/java/VariableNameUtils.java index 3c0205acc5a..90a960ee503 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/VariableNameUtils.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/VariableNameUtils.java @@ -16,9 +16,9 @@ package org.openrewrite.java; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Incubating; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.*; import java.text.Normalizer; @@ -119,7 +119,7 @@ public static Set findInheritedNames(J.ClassDeclaration classDeclaration return names; } - private static void addInheritedClassFields(J.ClassDeclaration classDeclaration, @Nullable JavaType.FullyQualified superClass, Set names) { + private static void addInheritedClassFields(J.ClassDeclaration classDeclaration, JavaType.@Nullable FullyQualified superClass, Set names) { if (superClass != null) { boolean isSamePackage = classDeclaration.getType() != null && classDeclaration.getType().getPackageName().equals(superClass.getPackageName()); superClass.getMembers().forEach(m -> { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ai/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/ai/package-info.java index 36d5049bb81..a0cd7668625 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ai/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ai/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.ai; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/cleanup/SimplifyBooleanExpressionVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/cleanup/SimplifyBooleanExpressionVisitor.java index cecc391f2f5..c84535285c4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/cleanup/SimplifyBooleanExpressionVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/cleanup/SimplifyBooleanExpressionVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.cleanup; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.search.SemanticallyEqual; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/cleanup/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/cleanup/package-info.java index f26f7bb1d3c..dc461ab8e32 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/cleanup/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/cleanup/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.cleanup; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/filter/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/filter/package-info.java index ce237e71cd1..9d7aacdcb07 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/filter/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/filter/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.filter; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/AutoFormatVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/AutoFormatVisitor.java index fd1c8411736..40e55a8ea3c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/AutoFormatVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/AutoFormatVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.*; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLines.java b/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLines.java index 606857d8b49..366314ec397 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLines.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLines.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.BlankLinesStyle; import org.openrewrite.java.style.IntelliJ; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLinesVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLinesVisitor.java index 7f069f0432e..7341d7874a0 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLinesVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/BlankLinesVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.BlankLinesStyle; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFile.java b/rewrite-java/src/main/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFile.java index 0c625a1c33a..8fc910d27c7 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFile.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/EmptyNewlineAtEndOfFile.java @@ -15,10 +15,10 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.Comment; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/MethodParamPad.java b/rewrite-java/src/main/java/org/openrewrite/java/format/MethodParamPad.java index cb85f996ccb..e298422f73a 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/MethodParamPad.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/MethodParamPad.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.Checkstyle; import org.openrewrite.java.style.IntelliJ; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/MinimumViableSpacingVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/MinimumViableSpacingVisitor.java index 5348b55dd17..d67926dbf4e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/MinimumViableSpacingVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/MinimumViableSpacingVisitor.java @@ -16,9 +16,9 @@ package org.openrewrite.java.format; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.ImplicitReturn; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceAfter.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceAfter.java index 19bd3c0cbc1..91a31e35655 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceAfter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceAfter.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.*; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceBefore.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceBefore.java index 82d120d1c85..cd39dff8a8f 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceBefore.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NoWhitespaceBefore.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.*; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeFormatVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeFormatVisitor.java index e4f32490d76..4632bfa111e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeFormatVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeFormatVisitor.java @@ -16,10 +16,10 @@ package org.openrewrite.java.format; import com.fasterxml.jackson.annotation.JsonCreator; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.JavadocVisitor; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaks.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaks.java index 182fbb0e916..12c35a748aa 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaks.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaks.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaksVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaksVisitor.java index 80393ef5690..1e6f9e72aae 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaksVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeLineBreaksVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.JavadocVisitor; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpaces.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpaces.java index 3081d4be863..e9c215464a2 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpaces.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpaces.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.IntelliJ; import org.openrewrite.java.style.TabsAndIndentsStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java index bda8e34f1aa..9ae6fdd6e01 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.JavadocVisitor; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/OperatorWrap.java b/rewrite-java/src/main/java/org/openrewrite/java/format/OperatorWrap.java index b00874f70d8..9412be2335a 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/OperatorWrap.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/OperatorWrap.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.Checkstyle; import org.openrewrite.java.style.OperatorWrapStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java b/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java index ca0d42a9e42..14ad68ac501 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/PadEmptyForLoopComponents.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.EmptyForInitializerPadStyle; import org.openrewrite.java.style.EmptyForIteratorPadStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/RemoveTrailingWhitespaceVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/RemoveTrailingWhitespaceVisitor.java index 6fa602bd29f..872381ea97d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/RemoveTrailingWhitespaceVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/RemoveTrailingWhitespaceVisitor.java @@ -16,8 +16,8 @@ package org.openrewrite.java.format; import com.fasterxml.jackson.annotation.JsonCreator; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/Spaces.java b/rewrite-java/src/main/java/org/openrewrite/java/format/Spaces.java index 265db7e8980..af02ea8702a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/Spaces.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/Spaces.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.EmptyForInitializerPadStyle; import org.openrewrite.java.style.EmptyForIteratorPadStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/SpacesVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/SpacesVisitor.java index 870a60c2cb6..dfd55844e54 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/SpacesVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/SpacesVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.EmptyForInitializerPadStyle; import org.openrewrite.java.style.EmptyForIteratorPadStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndents.java b/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndents.java index ae6218c9fe1..d3034d21bb7 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndents.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndents.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.IntelliJ; import org.openrewrite.java.style.TabsAndIndentsStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndentsVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndentsVisitor.java index 0a93390ddf9..1ed638fd9ef 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndentsVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/TabsAndIndentsVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.TabsAndIndentsStyle; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/TypecastParenPad.java b/rewrite-java/src/main/java/org/openrewrite/java/format/TypecastParenPad.java index 6ba52ca6534..b6296f9d23e 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/TypecastParenPad.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/TypecastParenPad.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.Checkstyle; import org.openrewrite.java.style.IntelliJ; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBraces.java b/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBraces.java index 7b48cc87de1..b64f06aa548 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBraces.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBraces.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.IntelliJ; import org.openrewrite.java.style.WrappingAndBracesStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBracesVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBracesVisitor.java index ef0af0a07d8..746acc38c14 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBracesVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/WrappingAndBracesVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.style.WrappingAndBracesStyle; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/format/package-info.java index 9d375f6cc22..9d77117c3ff 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.format; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/DefaultJavaTypeSignatureBuilder.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/DefaultJavaTypeSignatureBuilder.java index 7347b9edaf2..3f835a33cd4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/DefaultJavaTypeSignatureBuilder.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/DefaultJavaTypeSignatureBuilder.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.internal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeMapping.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeMapping.java index beec070d921..a7fb142280a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeMapping.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeMapping.java @@ -16,7 +16,7 @@ package org.openrewrite.java.internal; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeMapping; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeSignatureBuilder.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeSignatureBuilder.java index ea98f40fb00..f7cb551f390 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeSignatureBuilder.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaReflectionTypeSignatureBuilder.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.internal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import java.lang.reflect.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaTypeCache.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaTypeCache.java index 32cd3512569..16bb1c6ab36 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaTypeCache.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/JavaTypeCache.java @@ -16,7 +16,7 @@ package org.openrewrite.java.internal; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.xerial.snappy.Snappy; import java.io.IOException; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/TypesInUse.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/TypesInUse.java index fde5207f29e..ceb3d78773f 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/TypesInUse.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/TypesInUse.java @@ -18,8 +18,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/package-info.java index 4438fec4511..4403a58b226 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/AnnotationTemplateGenerator.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/AnnotationTemplateGenerator.java index 9c91693ce8a..76fef6d8df8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/AnnotationTemplateGenerator.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/AnnotationTemplateGenerator.java @@ -18,9 +18,9 @@ import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/BlockStatementTemplateGenerator.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/BlockStatementTemplateGenerator.java index 902127bf612..92ce7c4fb03 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/BlockStatementTemplateGenerator.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/BlockStatementTemplateGenerator.java @@ -21,10 +21,10 @@ import lombok.RequiredArgsConstructor; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.tree.*; @@ -87,8 +87,7 @@ public List listTemplatedTrees(JavaSourceFile cu, Class e new JavaIsoVisitor() { boolean done = false; - @Nullable - J.Block blockEnclosingTemplateComment; + J.@Nullable Block blockEnclosingTemplateComment; @Override public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Integer integer) { @@ -744,7 +743,7 @@ private static boolean referToSameElement(@Nullable Tree t1, @Nullable Tree t2) * Accepts a @FunctionalInterface and returns the single abstract method from it, or null if the single abstract * method cannot be found */ - private static @Nullable JavaType.Method findSingleAbstractMethod(@Nullable JavaType javaType) { + private static JavaType.@Nullable Method findSingleAbstractMethod(@Nullable JavaType javaType) { if (javaType == null) { return null; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/PatternVariables.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/PatternVariables.java index c79675055b6..96ffa084fec 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/PatternVariables.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/PatternVariables.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.internal.template; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Loop; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/Substitutions.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/Substitutions.java index 27460dfeab4..278e639c6a8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/Substitutions.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/Substitutions.java @@ -18,9 +18,9 @@ import lombok.RequiredArgsConstructor; import lombok.ToString; import org.antlr.v4.runtime.*; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.internal.grammar.TemplateParameterLexer; import org.openrewrite.java.internal.grammar.TemplateParameterParser; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TemplateParameter.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TemplateParameter.java index 3f5a56d29f8..d0fb65d9ead 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TemplateParameter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TemplateParameter.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.tree.JavaType; import org.openrewrite.marker.Marker; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TypeParameter.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TypeParameter.java index d5fe71c5366..201b7bf1326 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TypeParameter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/TypeParameter.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.internal.template; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.internal.grammar.TemplateParameterParser; import org.openrewrite.java.internal.grammar.TemplateParameterParserBaseVisitor; import org.openrewrite.java.tree.JavaType; @@ -30,7 +30,7 @@ public class TypeParameter { private static final JavaType.Class TYPE_OBJECT = JavaType.ShallowClass.build("java.lang.Object"); - public static JavaType toFullyQualifiedName(@Nullable TemplateParameterParser.TypeContext type) { + public static JavaType toFullyQualifiedName(TemplateParameterParser.@Nullable TypeContext type) { if (type == null) { return TYPE_OBJECT; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/package-info.java index 6956f358619..32c50482fd8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/internal/template/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/internal/template/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.internal.template; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaProject.java b/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaProject.java index 40a4a6dc39d..6bc26463fdd 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaProject.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaProject.java @@ -17,7 +17,7 @@ import lombok.*; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Marker; import java.util.UUID; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaSourceSet.java b/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaSourceSet.java index f9957b7cd06..e9ebd78a8d0 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaSourceSet.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/marker/JavaSourceSet.java @@ -22,8 +22,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.PathUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaTypeCache; import org.openrewrite.java.tree.JavaType; import org.openrewrite.marker.SourceSet; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/marker/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/marker/package-info.java index 5870908821d..6e1462053e5 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/marker/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/marker/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.marker; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/package-info.java index 1ee076b2785..e697a3e66c4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java index e524be095d0..9be46a8dd1e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/FindRecipes.java @@ -19,11 +19,11 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.ValueNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/recipes/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/recipes/package-info.java index ef8834b635f..4abf2d19b99 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/recipes/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/recipes/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.recipes; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/DeclaresMethod.java b/rewrite-java/src/main/java/org/openrewrite/java/search/DeclaresMethod.java index de28de0b31d..d0bea54bf3b 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/DeclaresMethod.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/DeclaresMethod.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindAnnotations.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindAnnotations.java index eb505921ca6..0585cfb5953 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindAnnotations.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindAnnotations.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java index d65da612aa8..e8a7689430c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedClasses.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.TypeMatcher; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedFields.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedFields.java index a6cb4ca8de1..fc5656dd290 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedFields.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedFields.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.TypeMatcher; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedMethods.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedMethods.java index e68c2023bbb..0d1b597cddd 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedMethods.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedMethods.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedUses.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedUses.java index 1c302df8377..a3ef78a6eb1 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedUses.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindDeprecatedUses.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Option; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; import java.util.Arrays; import java.util.List; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyMethods.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyMethods.java index 58be498983a..46e4065a08d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyMethods.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindEmptyMethods.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaType; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java index 05630a03f23..99dbbe4480d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindFields.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.java.JavaIsoVisitor; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.TypeMatcher; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindFieldsOfType.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindFieldsOfType.java index b3e51ef0acb..8090ba83280 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindFieldsOfType.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindFieldsOfType.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.TypeMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java index 87552eda45d..3ab78723cf8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindImports.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.TypeMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindInheritedFields.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindInheritedFields.java index e8fa8a14565..7791393b6a8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindInheritedFields.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindInheritedFields.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.search; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.Flag; import org.openrewrite.java.tree.J; @@ -44,7 +44,7 @@ public FindInheritedFieldsVisitor(String fullyQualifiedName) { this.fullyQualifiedName = fullyQualifiedName; } - private Set superFields(@Nullable JavaType.FullyQualified type) { + private Set superFields(JavaType.@Nullable FullyQualified type) { if (type == null || type.getSupertype() == null) { return emptySet(); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java index 97b304bd026..fc4746cff0c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethodDeclaration.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java index d93ba27bf81..5eb4d09bd18 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindMethods.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.table.MethodCalls; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindRepeatableAnnotations.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindRepeatableAnnotations.java index 0b5699816ba..ae230eaab2b 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindRepeatableAnnotations.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindRepeatableAnnotations.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java index e825f90bb65..3057bb8e899 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypeMappings.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.table.TypeMappings; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java index 112e99752f5..5c05e0477d4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/FindTypes.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.java.JavaIsoVisitor; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.table.TypeUses; @@ -164,7 +164,7 @@ public J.FieldAccess visitFieldAccess(J.FieldAccess fieldAccess, Set n } private static boolean typeMatches(boolean checkAssignability, Pattern pattern, - @Nullable JavaType.FullyQualified test) { + JavaType.@Nullable FullyQualified test) { return test != null && (checkAssignability ? test.isAssignableFrom(pattern) : pattern.matcher(test.getFullyQualifiedName()).matches() diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/HasBuildToolVersion.java b/rewrite-java/src/main/java/org/openrewrite/java/search/HasBuildToolVersion.java index 79629eea152..c9b4be80a71 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/HasBuildToolVersion.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/HasBuildToolVersion.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.BuildTool; import org.openrewrite.marker.SearchResult; import org.openrewrite.semver.Semver; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/HasJavaVersion.java b/rewrite-java/src/main/java/org/openrewrite/java/search/HasJavaVersion.java index df5451ec5f1..d88f60259e9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/HasJavaVersion.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/HasJavaVersion.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.JavaVersion; import org.openrewrite.marker.SearchResult; import org.openrewrite.semver.Semver; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/HasMinimumJavaVersion.java b/rewrite-java/src/main/java/org/openrewrite/java/search/HasMinimumJavaVersion.java index e1c670e9d76..31003a3e1bf 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/HasMinimumJavaVersion.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/HasMinimumJavaVersion.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaVersion; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/HasSourceSet.java b/rewrite-java/src/main/java/org/openrewrite/java/search/HasSourceSet.java index 12df03ddb23..0b606045f29 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/HasSourceSet.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/HasSourceSet.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/HasTypeOnClasspathSourceSet.java b/rewrite-java/src/main/java/org/openrewrite/java/search/HasTypeOnClasspathSourceSet.java index 8f7edce0510..12b702ebaf3 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/HasTypeOnClasspathSourceSet.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/HasTypeOnClasspathSourceSet.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/InJavaSourceSet.java b/rewrite-java/src/main/java/org/openrewrite/java/search/InJavaSourceSet.java index 35f81902ad3..fc0c197a4b5 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/InJavaSourceSet.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/InJavaSourceSet.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/IsLikelyTest.java b/rewrite-java/src/main/java/org/openrewrite/java/search/IsLikelyTest.java index db9cea3ba08..f3d2e14143a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/IsLikelyTest.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/IsLikelyTest.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java b/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java index d515e4dc3b9..9b05894768e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/ResultOfMethodCallIgnored.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java b/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java index 76040a58404..e2631a72234 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/SemanticallyEqual.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.Incubating; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesAllMethods.java b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesAllMethods.java index 4c8d9d463e8..d79847f0f60 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesAllMethods.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesAllMethods.java @@ -16,8 +16,8 @@ package org.openrewrite.java.search; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesField.java b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesField.java index cec0bd139f9..4b7f90c768e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesField.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesField.java @@ -16,9 +16,9 @@ package org.openrewrite.java.search; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.TypeMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesJavaVersion.java b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesJavaVersion.java index b02dcc5ee4d..6f91568fc06 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesJavaVersion.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesJavaVersion.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.search; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.marker.JavaVersion; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesMethod.java b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesMethod.java index 0ebb23b9435..f0625e64be8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesMethod.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesMethod.java @@ -19,8 +19,8 @@ import lombok.Getter; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesType.java b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesType.java index e8a5fc0a20b..6b5237e6697 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/UsesType.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/UsesType.java @@ -16,9 +16,9 @@ package org.openrewrite.java.search; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.JavaSourceFile; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/search/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/search/package-info.java index 9c11988165a..24990e21cff 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/search/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/search/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/service/AutoFormatService.java b/rewrite-java/src/main/java/org/openrewrite/java/service/AutoFormatService.java index 4126b7093cc..9b151307b7c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/service/AutoFormatService.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/service/AutoFormatService.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.service; +import org.jspecify.annotations.Nullable; import org.openrewrite.Incubating; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.format.AutoFormatVisitor; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/service/ImportService.java b/rewrite-java/src/main/java/org/openrewrite/java/service/ImportService.java index 7ab5bd5e2ff..51379bf31a3 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/service/ImportService.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/service/ImportService.java @@ -15,9 +15,9 @@ */ package org.openrewrite.java.service; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Incubating; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AddImport; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.ShortenFullyQualifiedTypeReferences; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/service/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/service/package-info.java index 8a95f702bc2..750441473a8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/service/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/service/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.service; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/Autodetect.java b/rewrite-java/src/main/java/org/openrewrite/java/style/Autodetect.java index 20b69e35f7b..c0cf10fe56e 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/Autodetect.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/Autodetect.java @@ -19,11 +19,11 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaIsoVisitor; import org.openrewrite.java.tree.*; import org.openrewrite.style.GeneralFormatStyle; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/CheckstyleConfigLoader.java b/rewrite-java/src/main/java/org/openrewrite/java/style/CheckstyleConfigLoader.java index 2398a8ff452..1d0b058b778 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/CheckstyleConfigLoader.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/CheckstyleConfigLoader.java @@ -19,7 +19,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.Configuration; import org.intellij.lang.annotations.Language; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.xml.sax.InputSource; import java.io.ByteArrayInputStream; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java b/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java index 8a0e4e9b0fc..bd808cc7d50 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.NonNull; +import org.jspecify.annotations.NonNull; import org.openrewrite.internal.lang.NullFields; import org.openrewrite.style.Style; import org.openrewrite.style.StyleHelper; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/ImportLayoutStyle.java b/rewrite-java/src/main/java/org/openrewrite/java/style/ImportLayoutStyle.java index 025ae237dbe..d662b3403ae 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/ImportLayoutStyle.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/ImportLayoutStyle.java @@ -28,9 +28,9 @@ import com.fasterxml.jackson.databind.jsontype.TypeSerializer; import lombok.EqualsAndHashCode; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaPrinter; import org.openrewrite.java.JavaStyle; import org.openrewrite.java.tree.*; @@ -106,7 +106,7 @@ public ImportLayoutStyle(int classCountToUseStarImport, int nameCountToUseStarIm * @return The import list with a new import added. */ public List> addImport(List> originalImports, - J.Import toAdd, @Nullable J.Package pkg, + J.Import toAdd, J.@Nullable Package pkg, Collection classpath) { JRightPadded paddedToAdd = new JRightPadded<>(toAdd, Space.EMPTY, Markers.EMPTY); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java b/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java index 4bd3006ecbf..cc88978e76d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.NonNull; +import org.jspecify.annotations.NonNull; import org.openrewrite.internal.lang.NullFields; import org.openrewrite.style.Style; import org.openrewrite.style.StyleHelper; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/style/package-info.java index adbdd203975..f7ff7124048 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.style; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/table/ClassHierarchy.java b/rewrite-java/src/main/java/org/openrewrite/java/table/ClassHierarchy.java index e0d78d6d4b7..96b6b05d5b9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/table/ClassHierarchy.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/table/ClassHierarchy.java @@ -16,10 +16,10 @@ package org.openrewrite.java.table; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; public class ClassHierarchy extends DataTable { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/table/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/table/package-info.java index f61d20917cb..45bc6def84c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/table/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/table/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.table; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/trait/Annotated.java b/rewrite-java/src/main/java/org/openrewrite/java/trait/Annotated.java index f686ba94134..681b446c62f 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/trait/Annotated.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/trait/Annotated.java @@ -17,8 +17,8 @@ import lombok.RequiredArgsConstructor; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/trait/Literal.java b/rewrite-java/src/main/java/org/openrewrite/java/trait/Literal.java index 18a05e04937..a56513338c4 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/trait/Literal.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/trait/Literal.java @@ -20,8 +20,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.tree.Expression; import org.openrewrite.java.tree.J; import org.openrewrite.trait.SimpleTraitMatcher; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/trait/MethodAccess.java b/rewrite-java/src/main/java/org/openrewrite/java/trait/MethodAccess.java index b591ec0d1bc..d5087341ab2 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/trait/MethodAccess.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/trait/MethodAccess.java @@ -17,11 +17,11 @@ import lombok.RequiredArgsConstructor; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Incubating; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.Expression; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/trait/VariableAccess.java b/rewrite-java/src/main/java/org/openrewrite/java/trait/VariableAccess.java index 4710fbebe0f..961ac3650c9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/trait/VariableAccess.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/trait/VariableAccess.java @@ -16,8 +16,8 @@ package org.openrewrite.java.trait; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaVisitor; import org.openrewrite.java.trait.internal.MaybeParenthesesPair; import org.openrewrite.java.tree.J; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/trait/internal/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/trait/internal/package-info.java index 962014eac18..8bf4a89d7a1 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/trait/internal/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/trait/internal/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.trait.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/trait/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/trait/package-info.java index bae3aa371c9..89d3d96dc05 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/trait/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/trait/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.java.trait; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/Expression.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/Expression.java index a65b5b5d051..e34efcec6a5 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/Expression.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/Expression.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/Flag.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/Flag.java index 8a177eccb01..059127b4256 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/Flag.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/Flag.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.*; import java.util.stream.Stream; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java index 5c483222a85..7ac3ec7b452 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java @@ -19,13 +19,13 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.LoathingOfOthers; import org.openrewrite.internal.SelfLoathing; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaPrinter; import org.openrewrite.java.JavaTypeVisitor; import org.openrewrite.java.JavaVisitor; @@ -961,8 +961,7 @@ final class Break implements J, Statement { Markers markers; @With - @Nullable - J.Identifier label; + J.@Nullable Identifier label; @Override public

J acceptJava(JavaVisitor

v, P p) { @@ -1258,8 +1257,7 @@ public ClassDeclaration withPermits(@Nullable List permitting) { Block body; @Getter - @Nullable - JavaType.FullyQualified type; + JavaType.@Nullable FullyQualified type; @SuppressWarnings("unchecked") @Override @@ -1634,8 +1632,7 @@ final class Continue implements J, Statement { Markers markers; @With - @Nullable - J.Identifier label; + J.@Nullable Identifier label; @Override public

J acceptJava(JavaVisitor

v, P p) { @@ -2451,14 +2448,13 @@ class Identifier implements J, TypeTree, Expression { @Nullable JavaType type; - @Nullable - JavaType.Variable fieldType; + JavaType.@Nullable Variable fieldType; /** * @deprecated Use {@link #Identifier(UUID, Space, Markers, List, String, JavaType, JavaType.Variable)} instead. */ @Deprecated - public Identifier(UUID id, Space prefix, Markers markers, String simpleName, @Nullable JavaType type, @Nullable JavaType.Variable fieldType) { + public Identifier(UUID id, Space prefix, Markers markers, String simpleName, @Nullable JavaType type, JavaType.@Nullable Variable fieldType) { this.id = id; this.prefix = prefix; this.markers = markers; @@ -2673,14 +2669,14 @@ public Import withStatic(boolean statik) { return getPadding().withStatic(this.statik.withElement(statik)); } - public @Nullable J.Identifier getAlias() { + public J.@Nullable Identifier getAlias() { if (alias == null) { return null; } return alias.getElement(); } - public J.Import withAlias(@Nullable J.Identifier alias) { + public J.Import withAlias(J.@Nullable Identifier alias) { if (this.alias == null) { if (alias == null) { return this; @@ -3443,17 +3439,15 @@ public CoordinateBuilder.Expression getCoordinates() { * In the case of a method reference, this is the method type pointed to by {@link #reference}. */ @With - @Nullable @Getter - JavaType.Method methodType; + JavaType.@Nullable Method methodType; /** * In the case of a field reference, this is the field pointed to by {@link #reference}. */ @With - @Nullable @Getter - JavaType.Variable variableType; + JavaType.@Nullable Variable variableType; @Override public

J acceptJava(JavaVisitor

v, P p) { @@ -3632,10 +3626,9 @@ public MethodDeclaration withDefaultValue(@Nullable Expression defaultValue) { } @Getter - @Nullable - JavaType.Method methodType; + JavaType.@Nullable Method methodType; - public MethodDeclaration withMethodType(@Nullable JavaType.Method type) { + public MethodDeclaration withMethodType(JavaType.@Nullable Method type) { if (type == this.methodType) { return this; } @@ -3881,12 +3874,12 @@ public MethodInvocation withArguments(List arguments) { return getPadding().withArguments(JContainer.withElements(this.arguments, arguments)); } - @Nullable + @Getter - JavaType.Method methodType; + JavaType.@Nullable Method methodType; @Override - public MethodInvocation withMethodType(@Nullable JavaType.Method type) { + public MethodInvocation withMethodType(JavaType.@Nullable Method type) { if (type == this.methodType) { return this; } @@ -4387,9 +4380,8 @@ public NewClass withArguments(List arguments) { Block body; @With - @Nullable @Getter - JavaType.Method constructorType; + JavaType.@Nullable Method constructorType; @Override public @Nullable JavaType getType() { @@ -4402,7 +4394,7 @@ public NewClass withArguments(List arguments) { * @return The constructor type. */ @Override - public @Nullable JavaType.Method getMethodType() { + public JavaType.@Nullable Method getMethodType() { return getConstructorType(); } @@ -4413,7 +4405,7 @@ public NewClass withArguments(List arguments) { * @return An instance with the new constructor type. */ @Override - public NewClass withMethodType(@Nullable JavaType.Method methodType) { + public NewClass withMethodType(JavaType.@Nullable Method methodType) { return withConstructorType(methodType); } @@ -4932,8 +4924,7 @@ public Primitive withType(@Nullable JavaType type) { } @Override - @NonNull - public JavaType.Primitive getType() { + public JavaType.@NonNull Primitive getType() { return type; } @@ -5816,7 +5807,7 @@ public List getAllAnnotations() { return allAnnotations; } - public @Nullable JavaType.FullyQualified getTypeAsFullyQualified() { + public JavaType.@Nullable FullyQualified getTypeAsFullyQualified() { return typeExpression == null ? null : TypeUtils.asFullyQualified(typeExpression.getType()); } @@ -5882,9 +5873,8 @@ public NamedVariable withInitializer(@Nullable Expression initializer) { } @With - @Nullable @Getter - JavaType.Variable variableType; + JavaType.@Nullable Variable variableType; @Override public JavaType getType() { diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/JContainer.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/JContainer.java index 18554288e9f..a299f98da67 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/JContainer.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/JContainer.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.util.List; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/JLeftPadded.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/JLeftPadded.java index d0ab7411054..e24090ba408 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/JLeftPadded.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/JLeftPadded.java @@ -33,7 +33,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.function.UnaryOperator; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/JRightPadded.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/JRightPadded.java index d8e952b752f..78c65a04a14 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/JRightPadded.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/JRightPadded.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaCoordinates.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaCoordinates.java index 019e1710132..04bf5e5e1f5 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaCoordinates.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaCoordinates.java @@ -18,7 +18,7 @@ import lombok.AccessLevel; import lombok.Data; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.template.Coordinates; import java.util.Comparator; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaSourceFile.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaSourceFile.java index 548dee1410f..97f3551c473 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaSourceFile.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaSourceFile.java @@ -15,10 +15,10 @@ */ package org.openrewrite.java.tree; +import org.jspecify.annotations.Nullable; import org.openrewrite.Incubating; import org.openrewrite.SourceFile; import org.openrewrite.internal.WhitespaceValidationService; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.JavaWhitespaceValidationService; import org.openrewrite.java.internal.TypesInUse; import org.openrewrite.java.service.AnnotationService; @@ -32,8 +32,7 @@ public interface JavaSourceFile extends J, SourceFile { TypesInUse getTypesInUse(); - @Nullable - J.Package getPackageDeclaration(); + J.@Nullable Package getPackageDeclaration(); JavaSourceFile withPackageDeclaration(J.Package pkg); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaType.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaType.java index 38c80fb7948..9ea02a41a1a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaType.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/JavaType.java @@ -21,9 +21,9 @@ import lombok.With; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Incubating; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.internal.DefaultJavaTypeSignatureBuilder; import java.util.*; @@ -1213,7 +1213,7 @@ public FullyQualified getDeclaringType() { return declaringType; } - public @Nullable JavaType.Method getOverride() { + public JavaType.@Nullable Method getOverride() { if (declaringType instanceof JavaType.Unknown) { return null; } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/Javadoc.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/Javadoc.java index cf47f4bebcc..56f58c9e7b7 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/Javadoc.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/Javadoc.java @@ -19,11 +19,11 @@ import lombok.Value; import lombok.With; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.PrintOutputCapture; import org.openrewrite.Tree; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavadocPrinter; import org.openrewrite.java.JavadocVisitor; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/MethodCall.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/MethodCall.java index 4e6cef2d353..0f0d4c67956 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/MethodCall.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/MethodCall.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; @@ -33,10 +33,9 @@ public interface MethodCall extends Expression { @Override MethodCall withType(@Nullable JavaType type); - @Nullable - JavaType.Method getMethodType(); + JavaType.@Nullable Method getMethodType(); - MethodCall withMethodType(@Nullable JavaType.Method methodType); + MethodCall withMethodType(JavaType.@Nullable Method methodType); List getArguments(); diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/Space.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/Space.java index 0a48ea002e8..48ddcce8ce8 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/Space.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/Space.java @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeTree.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeTree.java index 11c3f0eb5ed..248efcdccf3 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeTree.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeTree.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.java.marker.Quoted; import org.openrewrite.marker.Markers; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeUtils.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeUtils.java index cd3dfa04e33..65d58a07eab 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeUtils.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/TypeUtils.java @@ -15,8 +15,8 @@ */ package org.openrewrite.java.tree; +import org.jspecify.annotations.Nullable; import org.openrewrite.Incubating; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaTypeSignatureBuilder; import org.openrewrite.java.internal.DefaultJavaTypeSignatureBuilder; @@ -155,7 +155,7 @@ public static boolean isOfClassType(@Nullable JavaType type, String fqn) { */ @Incubating(since = "8.1.4") public static boolean isOfTypeWithName( - @Nullable JavaType.FullyQualified type, + JavaType.@Nullable FullyQualified type, boolean matchOverride, Predicate matcher ) { @@ -407,27 +407,27 @@ public static boolean isAssignableTo(Predicate predicate, @Nullable Ja return false; } - public static @Nullable JavaType.Class asClass(@Nullable JavaType type) { + public static JavaType.@Nullable Class asClass(@Nullable JavaType type) { return type instanceof JavaType.Class ? (JavaType.Class) type : null; } - public static @Nullable JavaType.Parameterized asParameterized(@Nullable JavaType type) { + public static JavaType.@Nullable Parameterized asParameterized(@Nullable JavaType type) { return type instanceof JavaType.Parameterized ? (JavaType.Parameterized) type : null; } - public static @Nullable JavaType.Array asArray(@Nullable JavaType type) { + public static JavaType.@Nullable Array asArray(@Nullable JavaType type) { return type instanceof JavaType.Array ? (JavaType.Array) type : null; } - public static @Nullable JavaType.GenericTypeVariable asGeneric(@Nullable JavaType type) { + public static JavaType.@Nullable GenericTypeVariable asGeneric(@Nullable JavaType type) { return type instanceof JavaType.GenericTypeVariable ? (JavaType.GenericTypeVariable) type : null; } - public static @Nullable JavaType.Primitive asPrimitive(@Nullable JavaType type) { + public static JavaType.@Nullable Primitive asPrimitive(@Nullable JavaType type) { return type instanceof JavaType.Primitive ? (JavaType.Primitive) type : null; } - public static @Nullable JavaType.FullyQualified asFullyQualified(@Nullable JavaType type) { + public static JavaType.@Nullable FullyQualified asFullyQualified(@Nullable JavaType type) { if (type instanceof JavaType.FullyQualified && !(type instanceof JavaType.Unknown)) { return (JavaType.FullyQualified) type; } @@ -440,7 +440,7 @@ public static boolean isAssignableTo(Predicate predicate, @Nullable Ja * @return `true` if a superclass or implemented interface declares a non-private method with matching signature. * `false` if a match is not found or the method, declaring type, or generic signature is null. */ - public static boolean isOverride(@Nullable JavaType.Method method) { + public static boolean isOverride(JavaType.@Nullable Method method) { return findOverriddenMethod(method).isPresent(); } @@ -453,7 +453,7 @@ public static boolean isOverride(@Nullable JavaType.Method method) { * * @return An optional overridden method type declared in the parent. */ - public static Optional findOverriddenMethod(@Nullable JavaType.Method method) { + public static Optional findOverriddenMethod(JavaType.@Nullable Method method) { if (method == null) { return Optional.empty(); } @@ -476,7 +476,7 @@ public static Optional findOverriddenMethod(@Nullable JavaType. .filter(m -> m.getFlags().contains(Flag.Public) || m.getDeclaringType().getPackageName().equals(dt.getPackageName())); } - public static Optional findDeclaredMethod(@Nullable JavaType.FullyQualified clazz, String name, List argumentTypes) { + public static Optional findDeclaredMethod(JavaType.@Nullable FullyQualified clazz, String name, List argumentTypes) { if (clazz == null) { return Optional.empty(); } @@ -578,7 +578,7 @@ private static boolean isWellFormedType0(JavaType type, Set seen) { return true; } - public static JavaType.FullyQualified unknownIfNull(@Nullable JavaType.FullyQualified t) { + public static JavaType.FullyQualified unknownIfNull(JavaType.@Nullable FullyQualified t) { if (t == null) { return JavaType.Unknown.getInstance(); } diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/TypedTree.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/TypedTree.java index 6839589b405..74dc7bfa1cf 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/TypedTree.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/TypedTree.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; /** * A tree with type attribution information. Unlike {@link TypeTree}, diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/package-info.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/package-info.java index 571b49590bf..97e47a90cbb 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/package-info.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.java.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-java/src/test/java/org/openrewrite/java/OpenRewriteArchitectureTest.java b/rewrite-java/src/test/java/org/openrewrite/java/OpenRewriteArchitectureTest.java index dcdaff705a6..ac8c319d760 100644 --- a/rewrite-java/src/test/java/org/openrewrite/java/OpenRewriteArchitectureTest.java +++ b/rewrite-java/src/test/java/org/openrewrite/java/OpenRewriteArchitectureTest.java @@ -21,7 +21,7 @@ import com.tngtech.archunit.junit.AnalyzeClasses; import com.tngtech.archunit.junit.ArchTest; import com.tngtech.archunit.lang.*; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import static com.tngtech.archunit.base.DescribedPredicate.doNot; import static com.tngtech.archunit.core.domain.properties.HasName.Predicates.name; @@ -65,7 +65,7 @@ public void check(JavaPackage javaPackage, ConditionEvents events) { @Override public void check(JavaPackage javaPackage, ConditionEvents events) { javaPackage.tryGetPackageInfo() - .filter(packageInfo -> !packageInfo.isAnnotatedWith(NonNullApi.class)) + .filter(packageInfo -> !packageInfo.isAnnotatedWith(NullMarked.class)) .ifPresent(packageInfo -> events.add(SimpleConditionEvent.violated(javaPackage, String.format("Package '%s' is not annotated as @NonNullApi", javaPackage.getName())))); } diff --git a/rewrite-java/src/test/java/org/openrewrite/java/internal/template/PatternVariablesTest.java b/rewrite-java/src/test/java/org/openrewrite/java/internal/template/PatternVariablesTest.java index de77661a935..35ee0ad15c6 100644 --- a/rewrite-java/src/test/java/org/openrewrite/java/internal/template/PatternVariablesTest.java +++ b/rewrite-java/src/test/java/org/openrewrite/java/internal/template/PatternVariablesTest.java @@ -16,9 +16,9 @@ package org.openrewrite.java.internal.template; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Statement; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/Assertions.java b/rewrite-json/src/main/java/org/openrewrite/json/Assertions.java index a5b18aaa06e..32ac9cc98d0 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/Assertions.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/Assertions.java @@ -16,7 +16,7 @@ package org.openrewrite.json; import org.intellij.lang.annotations.Language; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.json.tree.Json; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/JsonParser.java b/rewrite-json/src/main/java/org/openrewrite/json/JsonParser.java index 17b6db10408..80708eb9503 100755 --- a/rewrite-json/src/main/java/org/openrewrite/json/JsonParser.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/JsonParser.java @@ -17,9 +17,9 @@ import org.antlr.v4.runtime.*; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.Parser; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.internal.JsonParserVisitor; import org.openrewrite.json.internal.grammar.JSON5Lexer; import org.openrewrite.json.internal.grammar.JSON5Parser; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/JsonPathMatcher.java b/rewrite-json/src/main/java/org/openrewrite/json/JsonPathMatcher.java index 3e91ab0e4fa..7d51c43891f 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/JsonPathMatcher.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/JsonPathMatcher.java @@ -21,9 +21,9 @@ import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.internal.grammar.JsonPathLexer; import org.openrewrite.json.internal.grammar.JsonPathParser; import org.openrewrite.json.internal.grammar.JsonPathParserBaseVisitor; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/JsonVisitor.java b/rewrite-json/src/main/java/org/openrewrite/json/JsonVisitor.java index b79d5ea18e3..04fa161b57f 100755 --- a/rewrite-json/src/main/java/org/openrewrite/json/JsonVisitor.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/JsonVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.json; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.tree.Json; import org.openrewrite.json.tree.JsonRightPadded; import org.openrewrite.json.tree.JsonValue; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/internal/JsonParserVisitor.java b/rewrite-json/src/main/java/org/openrewrite/json/internal/JsonParserVisitor.java index 741564305a3..9142dce4be9 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/internal/JsonParserVisitor.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/internal/JsonParserVisitor.java @@ -18,9 +18,9 @@ import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.FileAttributes; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.internal.grammar.JSON5BaseVisitor; import org.openrewrite.json.internal.grammar.JSON5Parser; import org.openrewrite.json.tree.*; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/internal/package-info.java b/rewrite-json/src/main/java/org/openrewrite/json/internal/package-info.java index edbd80f90ce..234f4e6335d 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/internal/package-info.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.json.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/marker/package-info.java b/rewrite-json/src/main/java/org/openrewrite/json/marker/package-info.java index 2a15ac1f825..17dec00c013 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/marker/package-info.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/marker/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.json.marker; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/package-info.java b/rewrite-json/src/main/java/org/openrewrite/json/package-info.java index 70b259107e7..1437a3b32eb 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/package-info.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.json; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/search/package-info.java b/rewrite-json/src/main/java/org/openrewrite/json/search/package-info.java index 63df4a65483..dd56e2dcd67 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/search/package-info.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/search/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.json.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/tree/Json.java b/rewrite-json/src/main/java/org/openrewrite/json/tree/Json.java index 1328a16e7c1..bfa9fc8acca 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/tree/Json.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/tree/Json.java @@ -18,8 +18,8 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.json.JsonVisitor; import org.openrewrite.json.internal.JsonPrinter; import org.openrewrite.marker.Markers; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/tree/Space.java b/rewrite-json/src/main/java/org/openrewrite/json/tree/Space.java index 1f75925aa51..00b253c8e32 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/tree/Space.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/tree/Space.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.EqualsAndHashCode; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.*; diff --git a/rewrite-json/src/main/java/org/openrewrite/json/tree/package-info.java b/rewrite-json/src/main/java/org/openrewrite/json/tree/package-info.java index f100864e4dc..000caf12fc5 100644 --- a/rewrite-json/src/main/java/org/openrewrite/json/tree/package-info.java +++ b/rewrite-json/src/main/java/org/openrewrite/json/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.json.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependency.java index 32bbf4cd240..3688a54111a 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependency.java @@ -18,8 +18,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.marker.JavaProject; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.java.search.UsesType; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependencyVisitor.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependencyVisitor.java index 6137b9c8b32..5e18e33f15b 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependencyVisitor.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddDependencyVisitor.java @@ -16,9 +16,9 @@ package org.openrewrite.maven; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Validated; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.InsertDependencyComparator; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.MavenMetadata; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddDevelocityMavenExtension.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddDevelocityMavenExtension.java index 1cd49a0837c..9c8a09a9674 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddDevelocityMavenExtension.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddDevelocityMavenExtension.java @@ -26,8 +26,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.internal.MavenXmlMapper; import org.openrewrite.maven.tree.GroupArtifact; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependency.java index d6dc8e6b1c6..8b1db2ef5fd 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependency.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.marker.SearchResult; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.MavenMetadata; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependencyVisitor.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependencyVisitor.java index 4363cc39a49..ac7a5a410a8 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependencyVisitor.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddManagedDependencyVisitor.java @@ -16,8 +16,8 @@ package org.openrewrite.maven; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.InsertDependencyComparator; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.XPathMatcher; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddParentPom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddParentPom.java index d495affc70f..31082e62179 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddParentPom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddParentPom.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.marker.SearchResult; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.MavenMetadata; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java index 841a57fdc64..51eae9cbc73 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPlugin.java @@ -18,8 +18,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.XPathMatcher; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPluginDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPluginDependency.java index a10f469c61f..d224d282d16 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPluginDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPluginDependency.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddProfile.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddProfile.java index bdf87340700..8128be7cec1 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddProfile.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddProfile.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.RemoveContentVisitor; import org.openrewrite.xml.XPathMatcher; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java index c92f3823b4d..aa88e23ec83 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddProperty.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.tree.Xml; import java.util.Optional; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPropertyVisitor.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPropertyVisitor.java index 078f54f5ba5..c4c9c842d84 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddPropertyVisitor.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddPropertyVisitor.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.TagNameComparator; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddRepository.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddRepository.java index 92a38ec2283..2c8011df374 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddRepository.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddRepository.java @@ -19,11 +19,11 @@ import lombok.RequiredArgsConstructor; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.RemoveContentVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java b/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java index 7adcaa8ec10..daa2eeee209 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/AddRuntimeConfig.java @@ -17,9 +17,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import lombok.*; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.text.PlainText; import org.openrewrite.text.PlainTextVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/Assertions.java b/rewrite-maven/src/main/java/org/openrewrite/maven/Assertions.java index 555fa533e36..2a98c3213dd 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/Assertions.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/Assertions.java @@ -16,8 +16,8 @@ package org.openrewrite.maven; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyClassifier.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyClassifier.java index 1a5488b9e07..5f1afc788b1 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyClassifier.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyClassifier.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.RemoveContentVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyGroupIdAndArtifactId.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyGroupIdAndArtifactId.java index 30a0467d16e..c0cb645d7c0 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyGroupIdAndArtifactId.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyGroupIdAndArtifactId.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.MavenMetadata; import org.openrewrite.maven.tree.MavenResolutionResult; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyScope.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyScope.java index 19bbd087170..31fe5c32a95 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyScope.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeDependencyScope.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.RemoveContentVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeManagedDependencyGroupIdAndArtifactId.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeManagedDependencyGroupIdAndArtifactId.java index 19c6744d118..cc7204ea5a3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeManagedDependencyGroupIdAndArtifactId.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeManagedDependencyGroupIdAndArtifactId.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.MavenMetadata; import org.openrewrite.semver.Semver; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java index b2fc9ae0f15..2b9c21f7b60 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePackaging.java @@ -18,12 +18,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.MavenResolutionResult; import org.openrewrite.maven.tree.ResolvedPom; import org.openrewrite.xml.XPathMatcher; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java index f3a03469ebb..d58d187a4dc 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeParentPom.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.marker.SearchResult; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.table.MavenMetadataFailures; @@ -245,7 +245,7 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { return t; } - private boolean mismatches(@Nullable Xml.Tag relativePath, @Nullable String targetRelativePath) { + private boolean mismatches(Xml.@Nullable Tag relativePath, @Nullable String targetRelativePath) { if (relativePath == null) { return targetRelativePath != null; } diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginConfiguration.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginConfiguration.java index 7e38b951622..065a22c452c 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginConfiguration.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginConfiguration.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.XsltTransformation; import org.openrewrite.xml.XsltTransformationVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginDependencies.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginDependencies.java index 350f684ee69..ff2ff97bbe5 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginDependencies.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginDependencies.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginExecutions.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginExecutions.java index 41d48f80ffb..2a9645ca5b3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginExecutions.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginExecutions.java @@ -18,11 +18,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginGroupIdAndArtifactId.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginGroupIdAndArtifactId.java index 25d2e69f2b9..6b31516114e 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginGroupIdAndArtifactId.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePluginGroupIdAndArtifactId.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeProjectVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeProjectVersion.java index fa56790e65d..8f3c5891079 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeProjectVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangeProjectVersion.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.ResolvedPom; import org.openrewrite.xml.AddToTagVisitor; import org.openrewrite.xml.ChangeTagValueVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java index 027453a7caf..f74063d3962 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ChangePropertyValue.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.xml.ChangeTagValueVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ExcludeDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ExcludeDependency.java index 3226116b4f7..c7bce4a7968 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ExcludeDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ExcludeDependency.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.ResolvedDependency; import org.openrewrite.maven.tree.Scope; import org.openrewrite.xml.AddToTagVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java b/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java index 20ccdb90d65..1cf72265d5d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/ManageDependencies.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.*; import org.openrewrite.xml.RemoveContentVisitor; import org.openrewrite.xml.XPathMatcher; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingException.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingException.java index ba9292e4dc9..bea3e11a701 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingException.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingException.java @@ -17,8 +17,8 @@ import lombok.Getter; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markup; import org.openrewrite.maven.tree.GroupArtifactVersion; import org.openrewrite.maven.tree.MavenRepository; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingExceptions.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingExceptions.java index deb3276ddaf..caf8c7c52f3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingExceptions.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenDownloadingExceptions.java @@ -16,8 +16,8 @@ package org.openrewrite.maven; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markup; import org.openrewrite.maven.tree.GroupArtifact; import org.openrewrite.xml.XmlIsoVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java index 8f34c5ca5db..9bf7cd958ca 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenExecutionContextView.java @@ -15,9 +15,9 @@ */ package org.openrewrite.maven; +import org.jspecify.annotations.Nullable; import org.openrewrite.DelegatingExecutionContext; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.cache.InMemoryMavenPomCache; import org.openrewrite.maven.cache.MavenPomCache; import org.openrewrite.maven.internal.MavenParsingException; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java index 9839dc8a82a..89f18618ffd 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenParser.java @@ -17,8 +17,8 @@ import lombok.RequiredArgsConstructor; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.internal.RawPom; import org.openrewrite.maven.tree.MavenResolutionResult; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenSettings.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenSettings.java index e21597af0a0..ae23c9ff06b 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenSettings.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenSettings.java @@ -24,11 +24,11 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.MavenXmlMapper; import org.openrewrite.maven.internal.RawRepositories; import org.openrewrite.maven.tree.MavenRepository; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenVisitor.java b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenVisitor.java index a2497e4c392..2d9d99b87c3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/MavenVisitor.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/MavenVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.maven; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.tree.*; import org.openrewrite.xml.XPathMatcher; @@ -44,8 +44,8 @@ public class MavenVisitor

extends XmlVisitor

{ static final XPathMatcher PLUGIN_MATCHER = new XPathMatcher("//plugins/plugin"); static final XPathMatcher PARENT_MATCHER = new XPathMatcher("/project/parent"); - @Nullable - private transient Xml.Document document; + + private transient Xml.@Nullable Document document; @Nullable private transient MavenResolutionResult resolutionResult; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDependency.java index d1f99b9a935..fbcc52c1bd1 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDependency.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.ResolvedDependency; import org.openrewrite.maven.tree.Scope; import org.openrewrite.xml.RemoveContentVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java index 236a41914ba..ae4ea359cb2 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveDuplicateDependencies.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.maven.tree.Dependency; import org.openrewrite.maven.tree.ResolvedDependency; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java index b7804ffad90..55b7643d0be 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveExclusion.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.GroupArtifact; import org.openrewrite.maven.tree.ResolvedDependency; import org.openrewrite.maven.tree.ResolvedManagedDependency; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveManagedDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveManagedDependency.java index 7a20c9d6ace..6b0ff091bd3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveManagedDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveManagedDependency.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.ResolvedManagedDependency; import org.openrewrite.maven.tree.Scope; import org.openrewrite.xml.RemoveContentVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java index 917b85715b3..deda626fd3b 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRedundantDependencyVersions.java @@ -18,10 +18,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.tree.*; import org.openrewrite.semver.ExactVersion; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRepository.java b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRepository.java index e463bb5e639..161e9b5c455 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRepository.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/RemoveRepository.java @@ -18,11 +18,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.apache.commons.lang3.StringUtils; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenModel.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenModel.java index 7c43e81a83a..4833b0a25b0 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenModel.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenModel.java @@ -15,9 +15,9 @@ */ package org.openrewrite.maven; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.tree.*; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java index 7880c4e14f2..759f79feef0 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpdateMavenWrapper.java @@ -19,10 +19,10 @@ import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.BuildTool; import org.openrewrite.marker.Markers; import org.openrewrite.maven.utilities.MavenWrapper; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeDependencyVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeDependencyVersion.java index acb1aff9079..7d739a8e837 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeDependencyVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeDependencyVersion.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.*; import org.openrewrite.maven.utilities.RetainVersions; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeParentVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeParentVersion.java index 053f24f8469..e05b8741578 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeParentVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeParentVersion.java @@ -18,8 +18,8 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.semver.Semver; @Getter diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java index 9ec39535683..2d9793abd2e 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradePluginVersion.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.ci.GithubActionsBuildEnvironment; import org.openrewrite.maven.search.FindPlugin; import org.openrewrite.maven.table.MavenMetadataFailures; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeTransitiveDependencyVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeTransitiveDependencyVersion.java index 4c82277b352..ca0afa8b2e8 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeTransitiveDependencyVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/UpgradeTransitiveDependencyVersion.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.table.MavenMetadataFailures; import org.openrewrite.maven.tree.ResolvedDependency; import org.openrewrite.semver.Semver; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/CompositeMavenPomCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/CompositeMavenPomCache.java index ef028bea7a2..fde37b502a1 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/CompositeMavenPomCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/CompositeMavenPomCache.java @@ -16,7 +16,7 @@ package org.openrewrite.maven.cache; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.tree.*; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/InMemoryMavenPomCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/InMemoryMavenPomCache.java index 71233c84b3e..db5bf28929c 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/InMemoryMavenPomCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/InMemoryMavenPomCache.java @@ -20,7 +20,7 @@ import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.tree.*; import java.net.URI; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/LocalMavenArtifactCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/LocalMavenArtifactCache.java index e2c365f9513..0d45cef9136 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/LocalMavenArtifactCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/LocalMavenArtifactCache.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.ToString; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.tree.ResolvedDependency; import java.io.IOException; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenArtifactCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenArtifactCache.java index f21fea14622..efb71cfe2b4 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenArtifactCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenArtifactCache.java @@ -15,7 +15,7 @@ */ package org.openrewrite.maven.cache; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.tree.ResolvedDependency; import java.io.IOException; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenPomCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenPomCache.java index c45b3ed3d5f..bdc389e4d75 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenPomCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/MavenPomCache.java @@ -15,7 +15,7 @@ */ package org.openrewrite.maven.cache; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.tree.*; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/ReadOnlyLocalMavenArtifactCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/ReadOnlyLocalMavenArtifactCache.java index 65f7185ed3c..c841231c311 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/ReadOnlyLocalMavenArtifactCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/ReadOnlyLocalMavenArtifactCache.java @@ -15,7 +15,7 @@ */ package org.openrewrite.maven.cache; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.tree.ResolvedDependency; import java.io.InputStream; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/RocksdbMavenPomCache.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/RocksdbMavenPomCache.java index fa70ed0024d..aedd476a9a9 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cache/RocksdbMavenPomCache.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cache/RocksdbMavenPomCache.java @@ -27,7 +27,7 @@ import com.fasterxml.jackson.dataformat.smile.SmileGenerator; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.tree.*; import org.rocksdb.*; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/cleanup/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/cleanup/package-info.java index 79fe98f184c..e309af56a94 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/cleanup/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/cleanup/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven.cleanup; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java index 7096bcc16fa..ba2eb96e64f 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/MavenPomDownloader.java @@ -22,11 +22,11 @@ import io.micrometer.core.instrument.Metrics; import io.micrometer.core.instrument.Timer; import lombok.Getter; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.HttpSenderExecutionContextView; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.MavenExecutionContextView; @@ -382,7 +382,7 @@ public MavenMetadata downloadMetadata(GroupArtifactVersion gav, @Nullable Resolv } } - private @Nullable MavenMetadata.Versioning directoryToVersioning(String uri, GroupArtifactVersion gav) throws MavenDownloadingException { + private MavenMetadata.@Nullable Versioning directoryToVersioning(String uri, GroupArtifactVersion gav) throws MavenDownloadingException { Path dir = Paths.get(URI.create(uri)); if (Files.exists(dir)) { try (DirectoryStream stream = Files.newDirectoryStream(dir)) { @@ -400,7 +400,7 @@ public MavenMetadata downloadMetadata(GroupArtifactVersion gav, @Nullable Resolv return null; } - private @Nullable MavenMetadata.Versioning htmlIndexToVersioning(String responseBody, String uri) { + private MavenMetadata.@Nullable Versioning htmlIndexToVersioning(String responseBody, String uri) { // A very primitive approach, this just finds hrefs with trailing "/", List versions = new ArrayList<>(); int start = responseBody.indexOf(" mergeVersions(List versions1, List versions return new ArrayList<>(merged); } - private @Nullable MavenMetadata.Snapshot maxSnapshot(@Nullable MavenMetadata.Snapshot s1, @Nullable MavenMetadata.Snapshot s2) { + private MavenMetadata.@Nullable Snapshot maxSnapshot(MavenMetadata.@Nullable Snapshot s1, MavenMetadata.@Nullable Snapshot s2) { // apparently the snapshot timestamp is not always present in the metadata if (s1 == null || s1.getTimestamp() == null) { return s2; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java index ac15bc9b09c..4befdcfd431 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java @@ -23,9 +23,9 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.*; import javax.xml.bind.annotation.XmlRootElement; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawRepositories.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawRepositories.java index bf8937469d5..28dab9d9919 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawRepositories.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawRepositories.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import lombok.*; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/VersionRequirement.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/VersionRequirement.java index 90c90dede80..f488d30f79b 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/VersionRequirement.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/VersionRequirement.java @@ -21,7 +21,7 @@ import lombok.Value; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.tree.TerminalNode; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.internal.grammar.VersionRangeLexer; import org.openrewrite.maven.internal.grammar.VersionRangeParser; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/package-info.java index d94edbb8cd0..eb9371c76c6 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.maven.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/package-info.java index 4add8659d0c..eaee5cafa71 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/DependencyInsight.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/DependencyInsight.java index 323615bebed..b4dc4deeebb 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/DependencyInsight.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/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.java.marker.JavaProject; import org.openrewrite.java.marker.JavaSourceSet; import org.openrewrite.marker.Markup; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/DoesNotIncludeDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/DoesNotIncludeDependency.java index 2160c97f023..d081b3e9d01 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/DoesNotIncludeDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/DoesNotIncludeDependency.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.Scope; import static org.openrewrite.Validated.notBlank; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/EffectiveMavenRepositories.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/EffectiveMavenRepositories.java index 5271f57de55..0089a48724e 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/EffectiveMavenRepositories.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/EffectiveMavenRepositories.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.maven.MavenExecutionContextView; import org.openrewrite.maven.MavenIsoVisitor; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java index 3cff961e6f1..70d75e83113 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindDependency.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.maven.MavenIsoVisitor; import org.openrewrite.maven.tree.ResolvedDependency; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindManagedDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindManagedDependency.java index fce5e432bc5..9e87bfda487 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindManagedDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindManagedDependency.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.maven.MavenIsoVisitor; import org.openrewrite.semver.Semver; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindMavenSettings.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindMavenSettings.java index 80badc27103..a02ed7b9d0d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindMavenSettings.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindMavenSettings.java @@ -19,11 +19,11 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.MavenIsoVisitor; import org.openrewrite.maven.table.EffectiveMavenSettings; import org.openrewrite.maven.tree.MavenResolutionResult; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java index 168c8b64a65..04e0793ad1d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/FindProperties.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.maven.MavenVisitor; import org.openrewrite.maven.table.MavenProperties; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/ParentPomInsight.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/ParentPomInsight.java index ead4b2d599a..176a7a14983 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/ParentPomInsight.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/ParentPomInsight.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.maven.MavenIsoVisitor; import org.openrewrite.maven.table.ParentPomsInUse; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/search/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/search/package-info.java index 3d87268f8fd..462f771ae37 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/search/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/search/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/security/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/security/package-info.java index 695d8bf749c..ee9a4f92349 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/security/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/security/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven.security; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/table/DependenciesInUse.java b/rewrite-maven/src/main/java/org/openrewrite/maven/table/DependenciesInUse.java index 30a9e0cc1ff..a02b808d2a0 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/table/DependenciesInUse.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/table/DependenciesInUse.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; @JsonIgnoreType public class DependenciesInUse extends DataTable { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/table/MavenProperties.java b/rewrite-maven/src/main/java/org/openrewrite/maven/table/MavenProperties.java index e466367eb98..e88c60a9cea 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/table/MavenProperties.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/table/MavenProperties.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; @JsonIgnoreType public class MavenProperties extends DataTable { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/table/ParentPomsInUse.java b/rewrite-maven/src/main/java/org/openrewrite/maven/table/ParentPomsInUse.java index 46a66413756..133f7114adb 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/table/ParentPomsInUse.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/table/ParentPomsInUse.java @@ -17,10 +17,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreType; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Column; import org.openrewrite.DataTable; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.Nullable; @JsonIgnoreType public class ParentPomsInUse extends DataTable { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenDependency.java index e109a653518..45b0257773d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenDependency.java @@ -17,8 +17,8 @@ import lombok.Getter; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.tree.Dependency; import org.openrewrite.maven.tree.ResolvedDependency; import org.openrewrite.maven.tree.Scope; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenPlugin.java b/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenPlugin.java index 95be7e1f920..c4be15ef41e 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenPlugin.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/trait/MavenPlugin.java @@ -16,8 +16,8 @@ package org.openrewrite.maven.trait; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.trait.Trait; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/trait/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/trait/package-info.java index 56772cc1df5..7c6df4f7cd3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/trait/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/trait/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven.trait; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Dependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Dependency.java index c00d703d906..ca81924af8d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Dependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Dependency.java @@ -16,7 +16,7 @@ package org.openrewrite.maven.tree; import lombok.*; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; import java.util.List; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GraphvizResolutionEventListener.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GraphvizResolutionEventListener.java index 857c4ae3674..cf94887334e 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GraphvizResolutionEventListener.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GraphvizResolutionEventListener.java @@ -24,7 +24,7 @@ import guru.nidi.graphviz.model.MutableGraph; import guru.nidi.graphviz.model.MutableNode; import lombok.RequiredArgsConstructor; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GroupArtifactVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GroupArtifactVersion.java index 7c85c97b19c..2b32bd79067 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GroupArtifactVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/GroupArtifactVersion.java @@ -18,7 +18,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; import java.util.Objects; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/License.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/License.java index 49441ef381f..825d3490b0d 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/License.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/License.java @@ -16,7 +16,7 @@ package org.openrewrite.maven.tree; import lombok.Value; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ManagedDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ManagedDependency.java index 197ca8adc12..189b96d73fb 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ManagedDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ManagedDependency.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenMetadata.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenMetadata.java index c9085b46fcf..019c5034b34 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenMetadata.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenMetadata.java @@ -20,7 +20,7 @@ import lombok.Getter; import lombok.Value; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.internal.MavenXmlMapper; import org.openrewrite.xml.XmlParser; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepository.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepository.java index cedcd8e92d2..9664e053a63 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepository.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepository.java @@ -23,7 +23,7 @@ import lombok.experimental.Accessors; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.File; import java.io.Serializable; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepositoryMirror.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepositoryMirror.java index 2a8eeed6980..a1aa381e0a0 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepositoryMirror.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenRepositoryMirror.java @@ -18,7 +18,7 @@ import lombok.AccessLevel; import lombok.Data; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.MavenSettings; import java.net.URI; @@ -63,7 +63,7 @@ public class MavenRepositoryMirror { private final Set includedRepos; public MavenRepositoryMirror(@Nullable String id, @Nullable String url, @Nullable String mirrorOf, - @Nullable Boolean releases, @Nullable Boolean snapshots, @Nullable MavenSettings.Servers servers) { + @Nullable Boolean releases, @Nullable Boolean snapshots, MavenSettings.@Nullable Servers servers) { this.id = id; this.url = url; this.mirrorOf = mirrorOf; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenResolutionResult.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenResolutionResult.java index 057f1de2e8e..2ba1171e943 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenResolutionResult.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/MavenResolutionResult.java @@ -17,8 +17,8 @@ import lombok.*; import lombok.experimental.FieldDefaults; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.MavenDownloadingExceptions; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Parent.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Parent.java index 9b5aecfec7a..4bcbe9c3814 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Parent.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Parent.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; @Value @With diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Plugin.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Plugin.java index 331e494caa1..0c9edde7db3 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Plugin.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Plugin.java @@ -21,7 +21,7 @@ import lombok.AccessLevel; import lombok.Value; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.internal.MavenXmlMapper; import java.util.Collections; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Pom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Pom.java index 570d4e30cf4..6bd532cc6c7 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Pom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Pom.java @@ -19,8 +19,8 @@ import lombok.Builder; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.internal.MavenPomDownloader; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Profile.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Profile.java index cfd4f3a8f17..d83565cc23f 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Profile.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Profile.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; import java.util.Map; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ProfileActivation.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ProfileActivation.java index f078e35aae2..441cf922fd4 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ProfileActivation.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ProfileActivation.java @@ -18,7 +18,7 @@ import lombok.AccessLevel; import lombok.Data; import lombok.experimental.FieldDefaults; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.internal.VersionRequirement; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolutionEventListener.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolutionEventListener.java index 222159b0245..baee1173528 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolutionEventListener.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolutionEventListener.java @@ -15,7 +15,7 @@ */ package org.openrewrite.maven.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedDependency.java index 742b4640e50..d677c54ef57 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedDependency.java @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.*; import lombok.experimental.NonFinal; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; import java.util.*; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedGroupArtifactVersion.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedGroupArtifactVersion.java index 574ee44820b..ea9b2c6ac30 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedGroupArtifactVersion.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedGroupArtifactVersion.java @@ -18,7 +18,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.io.Serializable; import java.util.Objects; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedManagedDependency.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedManagedDependency.java index fe8d6e9fcbd..2b91c0fb675 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedManagedDependency.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedManagedDependency.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.util.List; import java.util.Objects; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedPom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedPom.java index 7791eda59f1..dcebe01b02c 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedPom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/ResolvedPom.java @@ -27,10 +27,10 @@ import lombok.Value; import lombok.With; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.PropertyPlaceholderHelper; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.MavenDownloadingExceptions; import org.openrewrite.maven.MavenExecutionContextView; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Scope.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Scope.java index 249a6b1f000..96f3b9207de 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Scope.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Scope.java @@ -15,7 +15,7 @@ */ package org.openrewrite.maven.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; public enum Scope { None, // the root of a resolution tree diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Version.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Version.java index 3c5253d8a69..46be82bf561 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Version.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/Version.java @@ -15,7 +15,7 @@ */ package org.openrewrite.maven.tree; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import java.math.BigInteger; import java.util.*; @@ -149,7 +149,7 @@ public boolean isNumber() { return (this.kind & 2) == 0; } - public int compareTo(@Nullable Version.Item that) { + public int compareTo(Version.@Nullable Item that) { int rel; if (that == null) { switch (this.kind) { diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/package-info.java index 80d44021271..01b5e9774d1 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/tree/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.maven.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenArtifactDownloader.java b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenArtifactDownloader.java index 9c3dd661f0c..0594b5bcac4 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenArtifactDownloader.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenArtifactDownloader.java @@ -18,7 +18,7 @@ import dev.failsafe.Failsafe; import dev.failsafe.FailsafeException; import dev.failsafe.RetryPolicy; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.ipc.http.HttpUrlConnectionSender; import org.openrewrite.maven.MavenDownloadingException; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java index 76b1a055170..6d00103acb7 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/MavenWrapper.java @@ -16,11 +16,11 @@ package org.openrewrite.maven.utilities; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Checksum; import org.openrewrite.ExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.maven.MavenDownloadingException; import org.openrewrite.maven.internal.MavenPomDownloader; import org.openrewrite.maven.tree.GroupArtifact; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/package-info.java b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/package-info.java index 338fdf22976..86408dd526b 100644 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/package-info.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/utilities/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven.utilities; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/AddDependencyTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/AddDependencyTest.java index e7b8e8a7c70..eaad20ee99b 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/AddDependencyTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/AddDependencyTest.java @@ -16,12 +16,12 @@ package org.openrewrite.maven; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.openrewrite.DocumentExample; import org.openrewrite.Issue; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java index 0cdf7e8fead..fc0a79c7701 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/AssertionsTest.java @@ -16,10 +16,10 @@ package org.openrewrite.maven; import lombok.AllArgsConstructor; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.test.RewriteTest; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java index f552190421d..52fc8e4d9a1 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/UpdateMavenWrapperTest.java @@ -16,10 +16,10 @@ package org.openrewrite.maven; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpUrlConnectionSender; import org.openrewrite.marker.BuildTool; import org.openrewrite.maven.utilities.MavenWrapper; diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/internal/MavenPomDownloaderTest.java b/rewrite-maven/src/test/java/org/openrewrite/maven/internal/MavenPomDownloaderTest.java index da60469c85a..2663320a74b 100755 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/internal/MavenPomDownloaderTest.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/internal/MavenPomDownloaderTest.java @@ -18,6 +18,7 @@ import okhttp3.mockwebserver.*; import org.assertj.core.api.Condition; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -25,7 +26,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.ipc.http.HttpUrlConnectionSender; import org.openrewrite.maven.MavenDownloadingException; diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/internal/package-info.java b/rewrite-maven/src/test/java/org/openrewrite/maven/internal/package-info.java index 4c2101d4091..97a4c53d1cf 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/internal/package-info.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/internal/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-maven/src/test/java/org/openrewrite/maven/package-info.java b/rewrite-maven/src/test/java/org/openrewrite/maven/package-info.java index 4add8659d0c..eaee5cafa71 100644 --- a/rewrite-maven/src/test/java/org/openrewrite/maven/package-info.java +++ b/rewrite-maven/src/test/java/org/openrewrite/maven/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.maven; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/AddProperty.java b/rewrite-properties/src/main/java/org/openrewrite/properties/AddProperty.java index 5ceaf77e999..11e4ba272f1 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/AddProperty.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/AddProperty.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.properties.search.FindProperties; import org.openrewrite.properties.tree.Properties; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/Assertions.java b/rewrite-properties/src/main/java/org/openrewrite/properties/Assertions.java index 46229695539..c88a8fcf318 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/Assertions.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/Assertions.java @@ -16,7 +16,7 @@ package org.openrewrite.properties; import org.intellij.lang.annotations.Language; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.properties.tree.Properties; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyKey.java b/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyKey.java index 777bce8a60d..729d5ddc982 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyKey.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyKey.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.NameCaseConvention; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.properties.tree.Properties; @Value diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyValue.java b/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyValue.java index 1d3b03bfa0e..68b5186c26b 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyValue.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/ChangePropertyValue.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.NameCaseConvention; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.properties.tree.Properties; import java.util.regex.Pattern; @@ -97,7 +97,7 @@ public Properties visitEntry(Properties.Entry entry, P p) { } // returns null if value should not change - private @Nullable Properties.Value updateValue(Properties.Value value) { + private Properties.@Nullable Value updateValue(Properties.Value value) { Properties.Value updatedValue = value.withText(Boolean.TRUE.equals(regex) ? value.getText().replaceAll(oldValue, newValue) : newValue); diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/CreatePropertiesFile.java b/rewrite-properties/src/main/java/org/openrewrite/properties/CreatePropertiesFile.java index 7964e13cd93..124ed2629c6 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/CreatePropertiesFile.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/CreatePropertiesFile.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.properties.tree.Properties; import java.nio.file.Path; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/DeleteProperty.java b/rewrite-properties/src/main/java/org/openrewrite/properties/DeleteProperty.java index f3fd13981e5..6e670f7ef04 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/DeleteProperty.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/DeleteProperty.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.properties.tree.Properties; import java.util.ArrayList; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java b/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java index 4cdcfe6ef3e..13d90e23f21 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesParser.java @@ -16,9 +16,9 @@ package org.openrewrite.properties; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.properties.tree.Properties; import org.openrewrite.tree.ParseError; @@ -113,7 +113,7 @@ private Properties.File parseFromInput(Path sourceFile, EncodingDetectingInputSt ); } - private @Nullable Properties.Content extractContent(String line, StringBuilder prefix) { + private Properties.@Nullable Content extractContent(String line, StringBuilder prefix) { Properties.Content content = null; if (line.trim().startsWith("#") || line.trim().startsWith("!")) { Properties.Comment.Delimiter delimiter = line.trim().startsWith("#") ? diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesVisitor.java b/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesVisitor.java index 0c8a5efd0f0..2535c826a7b 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesVisitor.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/PropertiesVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.properties; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.properties.tree.Properties; public class PropertiesVisitor

extends TreeVisitor { @@ -50,7 +50,7 @@ public Properties visitEntry(Properties.Entry entry, P p) { } //Note: Properties.Value does not currently implement Properties, so this is a bit of an outlier. - public @Nullable Properties.Value visitValue(Properties.Value value, P p) { + public Properties.@Nullable Value visitValue(Properties.Value value, P p) { return value.withMarkers(visitMarkers(value.getMarkers(), p)); } diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/internal/package-info.java b/rewrite-properties/src/main/java/org/openrewrite/properties/internal/package-info.java index 6f6376fb84e..961d93f0f1c 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/internal/package-info.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.properties.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/package-info.java b/rewrite-properties/src/main/java/org/openrewrite/properties/package-info.java index d44c22f1280..a0d5a884682 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/package-info.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.properties; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/search/FindProperties.java b/rewrite-properties/src/main/java/org/openrewrite/properties/search/FindProperties.java index f646e0d84fb..adbebe6254a 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/search/FindProperties.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/search/FindProperties.java @@ -17,13 +17,13 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.NameCaseConvention; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.properties.PropertiesVisitor; import org.openrewrite.properties.tree.Properties; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/search/package-info.java b/rewrite-properties/src/main/java/org/openrewrite/properties/search/package-info.java index 4da90ee9251..cb6bc2f05b5 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/search/package-info.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/search/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.properties.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/tree/Properties.java b/rewrite-properties/src/main/java/org/openrewrite/properties/tree/Properties.java index 4585f0d1b05..68dbc300da3 100755 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/tree/Properties.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/tree/Properties.java @@ -19,8 +19,8 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.properties.PropertiesVisitor; import org.openrewrite.properties.internal.PropertiesPrinter; diff --git a/rewrite-properties/src/main/java/org/openrewrite/properties/tree/package-info.java b/rewrite-properties/src/main/java/org/openrewrite/properties/tree/package-info.java index 0233b29d6f3..6e0e36acc4b 100644 --- a/rewrite-properties/src/main/java/org/openrewrite/properties/tree/package-info.java +++ b/rewrite-properties/src/main/java/org/openrewrite/properties/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.properties.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/Assertions.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/Assertions.java index d7e800f8aab..2ab21d30341 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/Assertions.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/Assertions.java @@ -16,7 +16,7 @@ package org.openrewrite.protobuf; import org.intellij.lang.annotations.Language; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.protobuf.tree.Proto; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoParser.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoParser.java index bbd419a439c..0bdb42ad260 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoParser.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoParser.java @@ -17,12 +17,12 @@ import org.antlr.v4.runtime.*; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.protobuf.internal.ProtoParserVisitor; import org.openrewrite.protobuf.internal.grammar.Protobuf2Lexer; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoVisitor.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoVisitor.java index 3a979a9ca52..0d335b37f22 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoVisitor.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/ProtoVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.protobuf; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.protobuf.tree.*; import java.util.List; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoParserVisitor.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoParserVisitor.java index 68dcf3e1d7a..a569bb249d6 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoParserVisitor.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoParserVisitor.java @@ -19,8 +19,8 @@ import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.FileAttributes; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.protobuf.internal.grammar.Protobuf2Parser; import org.openrewrite.protobuf.internal.grammar.Protobuf2ParserBaseVisitor; @@ -283,7 +283,7 @@ public FullName visitOptionName(Protobuf2Parser.OptionNameContext ctx) { return name; } - private @Nullable ProtoContainer mapOptionList(@Nullable Protobuf2Parser.OptionListContext ctx) { + private @Nullable ProtoContainer mapOptionList(Protobuf2Parser.@Nullable OptionListContext ctx) { if (ctx == null) { return null; } diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoPrinter.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoPrinter.java index ce443a85f9f..a6638f7b0f2 100755 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoPrinter.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/ProtoPrinter.java @@ -15,9 +15,9 @@ */ package org.openrewrite.protobuf.internal; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.PrintOutputCapture; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Markers; import org.openrewrite.protobuf.ProtoVisitor; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/package-info.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/package-info.java index 8c2c8c1ae20..c16e5a3e356 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/package-info.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.protobuf.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/package-info.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/package-info.java index 8656503f9c6..1831aa4acb8 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/package-info.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.protobuf; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Proto.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Proto.java index 7153931b43b..27164dae134 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Proto.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Proto.java @@ -18,8 +18,8 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.protobuf.ProtoVisitor; import org.openrewrite.protobuf.internal.ProtoPrinter; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoContainer.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoContainer.java index d30bd124685..a91f1dc8fb6 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoContainer.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoContainer.java @@ -17,8 +17,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import java.util.List; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoLeftPadded.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoLeftPadded.java index cb2fbcb9c71..b5df4abf16b 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoLeftPadded.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/ProtoLeftPadded.java @@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.function.UnaryOperator; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java index feda9317718..8acaf10ea0f 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/Space.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import lombok.EqualsAndHashCode; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.marker.Markers; import java.util.*; diff --git a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/package-info.java b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/package-info.java index 462f430c07e..e884e148a28 100644 --- a/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/package-info.java +++ b/rewrite-protobuf/src/main/java/org/openrewrite/protobuf/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.protobuf.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/AdHocRecipe.java b/rewrite-test/src/main/java/org/openrewrite/test/AdHocRecipe.java index b3282927be9..1d3d183e0c0 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/AdHocRecipe.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/AdHocRecipe.java @@ -19,9 +19,9 @@ import lombok.Value; import lombok.With; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.Collection; import java.util.Collections; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/AdHocScanningRecipe.java b/rewrite-test/src/main/java/org/openrewrite/test/AdHocScanningRecipe.java index 91c4968f7c0..5275c4ccf29 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/AdHocScanningRecipe.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/AdHocScanningRecipe.java @@ -19,9 +19,9 @@ import lombok.Value; import lombok.With; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.util.Collection; import java.util.Collections; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/LargeSourceSetCheckingExpectedCycles.java b/rewrite-test/src/main/java/org/openrewrite/test/LargeSourceSetCheckingExpectedCycles.java index d61dba179a9..60f12010be5 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/LargeSourceSetCheckingExpectedCycles.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/LargeSourceSetCheckingExpectedCycles.java @@ -15,11 +15,11 @@ */ package org.openrewrite.test; +import org.jspecify.annotations.Nullable; import org.openrewrite.Recipe; import org.openrewrite.Result; import org.openrewrite.SourceFile; import org.openrewrite.internal.InMemoryLargeSourceSet; -import org.openrewrite.internal.lang.Nullable; import java.nio.file.Path; import java.util.*; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java b/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java index 0ff2bb80f28..37f19778f2d 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/RecipeSpec.java @@ -21,11 +21,11 @@ import com.fasterxml.jackson.dataformat.csv.CsvSchema; import lombok.Getter; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.config.CompositeRecipe; import org.openrewrite.config.Environment; import org.openrewrite.config.YamlResourceLoader; -import org.openrewrite.internal.lang.Nullable; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -87,8 +87,7 @@ public static RecipeSpec defaults() { boolean serializationValidation = true; - @Nullable - PrintOutputCapture.MarkerPrinter markerPrinter; + PrintOutputCapture.@Nullable MarkerPrinter markerPrinter; List>> beforeRecipes = new ArrayList<>(); diff --git a/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java b/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java index 948989135bf..11a41feb255 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java @@ -18,6 +18,8 @@ import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; import org.assertj.core.api.SoftAssertions; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.config.CompositeRecipe; import org.openrewrite.config.Environment; @@ -26,8 +28,6 @@ import org.openrewrite.internal.RecipeIntrospectionUtils; import org.openrewrite.internal.StringUtils; import org.openrewrite.internal.WhitespaceValidationService; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Markers; import org.openrewrite.quark.Quark; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/SourceSpec.java b/rewrite-test/src/main/java/org/openrewrite/test/SourceSpec.java index 0a3353410cd..67df7769887 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/SourceSpec.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/SourceSpec.java @@ -18,11 +18,11 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Parser; import org.openrewrite.SourceFile; import org.openrewrite.internal.ThrowingConsumer; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.marker.Markers; import org.openrewrite.test.internal.ThrowingUnaryOperator; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/SourceSpecs.java b/rewrite-test/src/main/java/org/openrewrite/test/SourceSpecs.java index 9563acc33e8..195222374ff 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/SourceSpecs.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/SourceSpecs.java @@ -15,8 +15,8 @@ */ package org.openrewrite.test; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.quark.Quark; import org.openrewrite.quark.QuarkParser; import org.openrewrite.text.PlainText; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/package-info.java b/rewrite-test/src/main/java/org/openrewrite/test/package-info.java index 65408ebad23..c38683f36f5 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/package-info.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.test; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-test/src/test/java/org/openrewrite/test/internal/RewriteTestTest.java b/rewrite-test/src/test/java/org/openrewrite/test/internal/RewriteTestTest.java index cd5723276c1..dc175166bd3 100644 --- a/rewrite-test/src/test/java/org/openrewrite/test/internal/RewriteTestTest.java +++ b/rewrite-test/src/test/java/org/openrewrite/test/internal/RewriteTestTest.java @@ -16,10 +16,10 @@ package org.openrewrite.test.internal; import com.fasterxml.jackson.annotation.JsonCreator; +import org.jspecify.annotations.NullMarked; import org.junit.jupiter.api.Test; import org.openrewrite.Option; import org.openrewrite.Recipe; -import org.openrewrite.internal.lang.NonNullApi; import org.openrewrite.test.RewriteTest; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -62,7 +62,7 @@ void verifyAll() { } @SuppressWarnings("FieldCanBeLocal") -@NonNullApi +@NullMarked class RecipeWithNameOption extends Recipe { @Option private final String name; @@ -83,7 +83,7 @@ public String getDescription() { } } -@NonNullApi +@NullMarked class RecipeWithDescriptionListOfLinks extends Recipe { @Override @@ -100,7 +100,7 @@ public String getDescription() { } } -@NonNullApi +@NullMarked class RecipeWithDescriptionListOfDescribedLinks extends Recipe { @Override @@ -117,7 +117,7 @@ public String getDescription() { } } -@NonNullApi +@NullMarked class RecipeWithDescriptionNotEndingWithPeriod extends Recipe { @Override diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/AddToTagVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/AddToTagVisitor.java index e5e4c97c679..ee1c33fda04 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/AddToTagVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/AddToTagVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.xml; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.xml.tree.Content; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/Assertions.java b/rewrite-xml/src/main/java/org/openrewrite/xml/Assertions.java index f095dfae315..e6d9305a907 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/Assertions.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/Assertions.java @@ -16,7 +16,7 @@ package org.openrewrite.xml; import org.intellij.lang.annotations.Language; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeNamespaceValue.java b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeNamespaceValue.java index bdc33d1573d..7f7b4e49fbe 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeNamespaceValue.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeNamespaceValue.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.xml.trait.Namespaced; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagAttribute.java b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagAttribute.java index e5765acaec4..1c8a6b93a39 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagAttribute.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagAttribute.java @@ -17,12 +17,12 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.tree.Xml; import java.util.regex.Pattern; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValue.java b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValue.java index d1510a37b94..0773c33abba 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValue.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/ChangeTagValue.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.tree.Xml; @Value diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java b/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java index 04a35bfa548..873ac922799 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/CreateXmlFile.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.tree.Xml; import java.nio.file.Path; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/RemoveXmlTag.java b/rewrite-xml/src/main/java/org/openrewrite/xml/RemoveXmlTag.java index 0619b9fe787..0e856260342 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/RemoveXmlTag.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/RemoveXmlTag.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.tree.Xml; @Value diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/SemanticallyEqual.java b/rewrite-xml/src/main/java/org/openrewrite/xml/SemanticallyEqual.java index 23ed0ec4c45..288c598c15a 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/SemanticallyEqual.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/SemanticallyEqual.java @@ -15,7 +15,7 @@ */ package org.openrewrite.xml; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.xml.tree.Content; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/XPathMatcher.java b/rewrite-xml/src/main/java/org/openrewrite/xml/XPathMatcher.java index 0e8d60ec444..8ca660a975d 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/XPathMatcher.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/XPathMatcher.java @@ -15,9 +15,9 @@ */ package org.openrewrite.xml; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.search.FindTags; import org.openrewrite.xml.trait.Namespaced; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/XmlParser.java b/rewrite-xml/src/main/java/org/openrewrite/xml/XmlParser.java index ce6bf58ba44..70a3d476db7 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/XmlParser.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/XmlParser.java @@ -17,10 +17,10 @@ import org.antlr.v4.runtime.*; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.Parser; import org.openrewrite.internal.EncodingDetectingInputStream; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.tree.ParseError; import org.openrewrite.tree.ParsingEventListener; import org.openrewrite.tree.ParsingExecutionContextView; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/XmlVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/XmlVisitor.java index 16e322090c9..8025035f535 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/XmlVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/XmlVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.xml; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.format.AutoFormatVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/XsltTransformation.java b/rewrite-xml/src/main/java/org/openrewrite/xml/XsltTransformation.java index 8f987cd663d..dd2edd86184 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/XsltTransformation.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/XsltTransformation.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import java.io.IOException; import java.io.InputStream; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutoFormatVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutoFormatVisitor.java index 3ab9925b6b1..c3fcb48c9ff 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutoFormatVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutoFormatVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.style.NamedStyles; import org.openrewrite.xml.XmlVisitor; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutodetectGeneralFormatStyle.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutodetectGeneralFormatStyle.java index 250e7630d51..c4870d06c43 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutodetectGeneralFormatStyle.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/AutodetectGeneralFormatStyle.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.xml.XmlVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/LineBreaksVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/LineBreaksVisitor.java index 34c58d669b5..1db7b7f11df 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/LineBreaksVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/LineBreaksVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Misc; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/MinimumViableSpacingVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/MinimumViableSpacingVisitor.java index 3497b6f0d05..60b50081581 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/MinimumViableSpacingVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/MinimumViableSpacingVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeFormatVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeFormatVisitor.java index 8fb1f4b765b..bd44961a24c 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeFormatVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeFormatVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeLineBreaksVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeLineBreaksVisitor.java index 12c8736af2a..90467568ff4 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeLineBreaksVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeLineBreaksVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java index 1133c28bfb4..3251f773774 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java @@ -15,10 +15,10 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.NonNull; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.style.TabsAndIndentsStyle; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/RemoveTrailingWhitespaceVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/RemoveTrailingWhitespaceVisitor.java index eab837e0f75..51160e67ff1 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/RemoveTrailingWhitespaceVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/RemoveTrailingWhitespaceVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/TabsAndIndentsVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/TabsAndIndentsVisitor.java index 34a4d041cef..568ff0f9bbe 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/TabsAndIndentsVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/TabsAndIndentsVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.xml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.style.TabsAndIndentsStyle; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/package-info.java index 15fb387c7e6..6168a1ebbcd 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.xml.format; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlParserVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlParserVisitor.java index 7d2b7d01e10..ca3c51a0cdc 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlParserVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/XmlParserVisitor.java @@ -19,8 +19,8 @@ import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.FileAttributes; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.xml.internal.grammar.XMLParser; import org.openrewrite.xml.internal.grammar.XMLParserBaseVisitor; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/package-info.java index c88dcab135d..f025f35b4c7 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/internal/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.xml.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/package-info.java index d833a56b986..6645d19357c 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.xml; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindNamespacePrefix.java b/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindNamespacePrefix.java index c85203389ab..3681faebef0 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindNamespacePrefix.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindNamespacePrefix.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.xml.trait.Namespaced; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindTags.java b/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindTags.java index 88f8aa3ac77..743ea315ead 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindTags.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/search/FindTags.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.XmlVisitor; @@ -81,7 +81,7 @@ public Xml visitTag(Xml.Tag tag, Set ts) { */ @SuppressWarnings("unused") @Incubating(since = "7.33.0") - public static @Nullable Xml.Tag findSingle(Xml x, String xPath) { + public static Xml.@Nullable Tag findSingle(Xml x, String xPath) { final Set tags = find(x, xPath); if (tags.size() != 1) { return null; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/search/HasNamespaceUri.java b/rewrite-xml/src/main/java/org/openrewrite/xml/search/HasNamespaceUri.java index 599dd1b2a1c..d59b9f3047d 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/search/HasNamespaceUri.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/search/HasNamespaceUri.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.xml.trait.Namespaced; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/search/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/search/package-info.java index b9090600f51..b22fe5ad0b0 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/search/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/search/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.xml.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/security/AddOwaspDateBoundSuppressions.java b/rewrite-xml/src/main/java/org/openrewrite/xml/security/AddOwaspDateBoundSuppressions.java index deb23da86f3..c6316f583ca 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/security/AddOwaspDateBoundSuppressions.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/security/AddOwaspDateBoundSuppressions.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.XmlIsoVisitor; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/security/UpdateOwaspSuppressionDate.java b/rewrite-xml/src/main/java/org/openrewrite/xml/security/UpdateOwaspSuppressionDate.java index 055e853e3b2..18611ffac3b 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/security/UpdateOwaspSuppressionDate.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/security/UpdateOwaspSuppressionDate.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.XmlIsoVisitor; import org.openrewrite.xml.tree.Xml; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/security/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/security/package-info.java index 01a406b523e..2d3589dd369 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/security/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/security/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.xml.security; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/style/Autodetect.java b/rewrite-xml/src/main/java/org/openrewrite/xml/style/Autodetect.java index d162433c9e2..22cf238a7ae 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/style/Autodetect.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/style/Autodetect.java @@ -16,9 +16,9 @@ package org.openrewrite.xml.style; import com.fasterxml.jackson.annotation.JsonCreator; +import org.jspecify.annotations.Nullable; import org.openrewrite.SourceFile; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.style.NamedStyles; import org.openrewrite.style.Style; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/style/AutodetectDebug.java b/rewrite-xml/src/main/java/org/openrewrite/xml/style/AutodetectDebug.java index 5306417b929..0be90323a14 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/style/AutodetectDebug.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/style/AutodetectDebug.java @@ -15,10 +15,10 @@ */ package org.openrewrite.xml.style; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.NamedStyles; import org.openrewrite.xml.XmlVisitor; import org.openrewrite.xml.table.XmlStyleReport; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/style/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/style/package-info.java index 36b2b6e6d43..7c4b039b0c5 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/style/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/style/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.xml.style; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/trait/Namespaced.java b/rewrite-xml/src/main/java/org/openrewrite/xml/trait/Namespaced.java index d97aadac149..9595f6c0da5 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/trait/Namespaced.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/trait/Namespaced.java @@ -16,9 +16,9 @@ package org.openrewrite.xml.trait; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.trait.SimpleTraitMatcher; import org.openrewrite.trait.Trait; import org.openrewrite.xml.XPathMatcher; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/trait/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/trait/package-info.java index 782f1525bc3..1f4c2f6fd0b 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/trait/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/trait/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.xml.trait; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/tree/Xml.java b/rewrite-xml/src/main/java/org/openrewrite/xml/tree/Xml.java index cc3ef8a1a44..4331d605b87 100755 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/tree/Xml.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/tree/Xml.java @@ -19,9 +19,9 @@ import lombok.experimental.FieldDefaults; import org.apache.commons.text.StringEscapeUtils; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.WhitespaceValidationService; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.xml.XmlParser; import org.openrewrite.xml.XmlVisitor; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/tree/package-info.java b/rewrite-xml/src/main/java/org/openrewrite/xml/tree/package-info.java index 3358763de41..ba56656841d 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/tree/package-info.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.xml.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequence.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequence.java index 51fc84d13a5..407f55a728e 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequence.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequence.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Option; import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; -import org.openrewrite.internal.lang.Nullable; import java.util.List; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequenceVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequenceVisitor.java index 19f5bd6894f..7daa6826426 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequenceVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/AppendToSequenceVisitor.java @@ -16,9 +16,9 @@ package org.openrewrite.yaml; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.AlreadyReplaced; import org.openrewrite.marker.Markers; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/Assertions.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/Assertions.java index abd41b4ecdd..60ed2f90d1c 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/Assertions.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/Assertions.java @@ -16,7 +16,7 @@ package org.openrewrite.yaml; import org.intellij.lang.annotations.Language; -import org.openrewrite.internal.lang.Nullable; +import org.jspecify.annotations.Nullable; import org.openrewrite.test.SourceSpec; import org.openrewrite.test.SourceSpecs; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyKey.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyKey.java index 652f69db9b9..cee27689614 100755 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyKey.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyKey.java @@ -17,11 +17,11 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.NameCaseConvention; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.yaml.search.FindProperty; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyValue.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyValue.java index 98799dd5147..cf28ca0ed20 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyValue.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangePropertyValue.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.NameCaseConvention; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.tree.Yaml; import java.util.Iterator; @@ -108,7 +108,7 @@ public Yaml.Mapping.Entry visitMappingEntry(Yaml.Mapping.Entry entry, ExecutionC } // returns null if value should not change - private @Nullable Yaml.Scalar updateValue(Yaml.Block value) { + private Yaml.@Nullable Scalar updateValue(Yaml.Block value) { if (!(value instanceof Yaml.Scalar)) { return null; } diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java index b9bb2c79797..34a1f3b4871 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/ChangeValue.java @@ -17,8 +17,8 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java index 5872c443bbf..080a2fc6d91 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CopyValue.java @@ -18,8 +18,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.tree.Yaml; import java.nio.file.Path; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java index 4ef52c58ddd..157cb2f7db3 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/CreateYamlFile.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.remote.Remote; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java index bae075dac6f..c5ad799ae41 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteKey.java @@ -17,9 +17,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.tree.Yaml; import java.util.concurrent.atomic.AtomicReference; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java index b9b16ac5215..de995db8fa9 100755 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/DeleteProperty.java @@ -18,10 +18,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; import lombok.With; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; import org.openrewrite.internal.NameCaseConvention; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Marker; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/JsonPathMatcher.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/JsonPathMatcher.java index 1eac3d06124..c8aaed96969 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/JsonPathMatcher.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/JsonPathMatcher.java @@ -21,9 +21,9 @@ import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.internal.grammar.JsonPathLexer; import org.openrewrite.yaml.internal.grammar.JsonPathParser; import org.openrewrite.yaml.internal.grammar.JsonPathParserBaseVisitor; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYaml.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYaml.java index de935f1e51c..8febdc6b97a 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYaml.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYaml.java @@ -18,9 +18,9 @@ import lombok.EqualsAndHashCode; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.tree.Yaml; @Value diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYamlVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYamlVisitor.java index c8bc3ca2733..ba7d4489bbe 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYamlVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/MergeYamlVisitor.java @@ -18,9 +18,9 @@ import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.tree.Yaml; import java.util.ArrayList; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java index 246ed83b144..047c91789a8 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlParser.java @@ -18,13 +18,13 @@ import lombok.Getter; import lombok.Value; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.FileAttributes; import org.openrewrite.InMemoryExecutionContext; import org.openrewrite.SourceFile; import org.openrewrite.internal.EncodingDetectingInputStream; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.tree.ParseError; import org.openrewrite.tree.ParsingEventListener; @@ -453,15 +453,15 @@ private static class MappingBuilder implements BlockBuilder { @Nullable private final String startBracePrefix; - @Nullable - private final Yaml.Anchor anchor; + + private final Yaml.@Nullable Anchor anchor; private final List entries = new ArrayList<>(); @Nullable private YamlKey key; - private MappingBuilder(String prefix, @Nullable String startBracePrefix, @Nullable Yaml.Anchor anchor) { + private MappingBuilder(String prefix, @Nullable String startBracePrefix, Yaml.@Nullable Anchor anchor) { this.prefix = prefix; this.startBracePrefix = startBracePrefix; this.anchor = anchor; @@ -507,12 +507,12 @@ private static class SequenceBuilder implements BlockBuilder { @Nullable private final String startBracketPrefix; - @Nullable - private final Yaml.Anchor anchor; + + private final Yaml.@Nullable Anchor anchor; private final List entries = new ArrayList<>(); - private SequenceBuilder(String prefix, @Nullable String startBracketPrefix, @Nullable Yaml.Anchor anchor) { + private SequenceBuilder(String prefix, @Nullable String startBracketPrefix, Yaml.@Nullable Anchor anchor) { this.prefix = prefix; this.startBracketPrefix = startBracketPrefix; this.anchor = anchor; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlVisitor.java index bae24ae9246..63b5ecb5069 100755 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/YamlVisitor.java @@ -15,11 +15,11 @@ */ package org.openrewrite.yaml; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.SourceFile; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.cleanup.RemoveUnusedVisitor; import org.openrewrite.yaml.format.AutoFormatVisitor; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/RemoveUnusedVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/RemoveUnusedVisitor.java index 7dea524b2bd..2f7852d4701 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/RemoveUnusedVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/RemoveUnusedVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.yaml.cleanup; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.internal.ListUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/package-info.java index f3bb3be76b2..ce3e90f1732 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/cleanup/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.yaml.cleanup; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/AutoFormatVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/AutoFormatVisitor.java index c7889af15b6..5ddff39541d 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/AutoFormatVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/AutoFormatVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.yaml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.style.Autodetect; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/IndentsVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/IndentsVisitor.java index 0d33b91f4d6..7d7bbd2c079 100755 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/IndentsVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/IndentsVisitor.java @@ -15,9 +15,9 @@ */ package org.openrewrite.yaml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.style.IndentsStyle; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/MinimumViableSpacingVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/MinimumViableSpacingVisitor.java index c9522f6e4ee..cbd3ab9e783 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/MinimumViableSpacingVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/MinimumViableSpacingVisitor.java @@ -16,8 +16,8 @@ package org.openrewrite.yaml.format; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeFormatVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeFormatVisitor.java index 60bf61ca199..2bb6117afca 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeFormatVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeFormatVisitor.java @@ -16,8 +16,8 @@ package org.openrewrite.yaml.format; import lombok.RequiredArgsConstructor; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeLineBreaksVisitor.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeLineBreaksVisitor.java index da5eef96ea7..b50e8e5db17 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeLineBreaksVisitor.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/NormalizeLineBreaksVisitor.java @@ -15,8 +15,8 @@ */ package org.openrewrite.yaml.format; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.tree.Yaml; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/package-info.java index c6c441c335d..9edb777db1e 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/format/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.yaml.format; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/package-info.java index 8dbfbf4eed9..e8c00cfebde 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/internal/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.yaml.internal; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/package-info.java index 1d3cf6aaa09..9aa86df211b 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.yaml; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/FindProperty.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/FindProperty.java index 36a7d800e43..af06020f761 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/FindProperty.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/FindProperty.java @@ -17,10 +17,10 @@ import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.NameCaseConvention; import org.openrewrite.internal.StringUtils; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.SearchResult; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.YamlVisitor; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/package-info.java index bf2114229c4..f0aaf99c242 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/search/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.yaml.search; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/Autodetect.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/Autodetect.java index 0e1b7eefe34..83b4169c2b7 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/Autodetect.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/Autodetect.java @@ -15,8 +15,8 @@ */ package org.openrewrite.yaml.style; +import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.style.GeneralFormatStyle; import org.openrewrite.yaml.YamlIsoVisitor; import org.openrewrite.yaml.search.FindIndentYamlVisitor; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/package-info.java index 8e0c7c1913c..fdf27d48beb 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/style/package-info.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked @NonNullFields package org.openrewrite.yaml.style; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; import org.openrewrite.internal.lang.NonNullFields; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/Yaml.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/Yaml.java index 8a659708bbf..22f1ffaf1a4 100755 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/Yaml.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/Yaml.java @@ -17,8 +17,8 @@ import lombok.*; import lombok.experimental.FieldDefaults; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.marker.Markers; import org.openrewrite.yaml.YamlVisitor; import org.openrewrite.yaml.internal.YamlPrinter; diff --git a/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/package-info.java b/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/package-info.java index ad7a9bae9b2..3a4fa59dafa 100644 --- a/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/package-info.java +++ b/rewrite-yaml/src/main/java/org/openrewrite/yaml/tree/package-info.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi +@NullMarked package org.openrewrite.yaml.tree; -import org.openrewrite.internal.lang.NonNullApi; +import org.jspecify.annotations.NullMarked; diff --git a/rewrite-yaml/src/test/java/org/openrewrite/yaml/CreateYamlFileTest.java b/rewrite-yaml/src/test/java/org/openrewrite/yaml/CreateYamlFileTest.java index f590b822b8a..02501aa9738 100644 --- a/rewrite-yaml/src/test/java/org/openrewrite/yaml/CreateYamlFileTest.java +++ b/rewrite-yaml/src/test/java/org/openrewrite/yaml/CreateYamlFileTest.java @@ -16,11 +16,11 @@ package org.openrewrite.yaml; import org.intellij.lang.annotations.Language; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.HttpSenderExecutionContextView; import org.openrewrite.InMemoryExecutionContext; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.remote.RemoteArtifactCache; import org.openrewrite.remote.RemoteExecutionContextView; import org.openrewrite.test.MockHttpSender; From 4831b6f585661879a5cc2ea29b197433b4e71cde Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 00:41:11 -0400 Subject: [PATCH 02/11] Move Nullable annotation on fully qualified type name --- .../java/isolated/ReloadableJava11TypeMapping.java | 4 ++-- .../java/isolated/ReloadableJava17TypeMapping.java | 4 ++-- .../java/isolated/ReloadableJava21TypeMapping.java | 4 ++-- .../java/org/openrewrite/java/ReloadableJava8TypeMapping.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java index 8b35189e5b5..2b55dee5862 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java @@ -48,7 +48,7 @@ class ReloadableJava11TypeMapping implements JavaTypeMapping { private final JavaTypeCache typeCache; - public JavaType type(@Nullable com.sun.tools.javac.code.Type type) { + public JavaType type(com.sun.tools.javac.code.@Nullable Type type) { if (type == null || type instanceof Type.ErrorType || type instanceof Type.PackageType || type instanceof Type.UnknownType || type instanceof NullType) { return JavaType.Class.Unknown.getInstance(); @@ -447,7 +447,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(com.sun.tools.javac.code.@Nullable Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.Kind.ERR || symbol.type instanceof Type.UnknownType) { return null; } diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java index 74af1f8a7d6..65bc3847ea7 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java @@ -45,7 +45,7 @@ class ReloadableJava17TypeMapping implements JavaTypeMapping { private final JavaTypeCache typeCache; - public JavaType type(@Nullable com.sun.tools.javac.code.Type type) { + public JavaType type(com.sun.tools.javac.code.@Nullable Type type) { if (type == null || type instanceof Type.ErrorType || type instanceof Type.PackageType || type instanceof Type.UnknownType || type instanceof NullType) { return JavaType.Class.Unknown.getInstance(); @@ -446,7 +446,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(com.sun.tools.javac.code.@Nullable Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.Kind.ERR || symbol.type instanceof Type.UnknownType) { return null; } diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java index afb488cc499..c9fe0371d3b 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java @@ -45,7 +45,7 @@ class ReloadableJava21TypeMapping implements JavaTypeMapping { private final JavaTypeCache typeCache; - public JavaType type(@Nullable com.sun.tools.javac.code.Type type) { + public JavaType type(com.sun.tools.javac.code.@Nullable Type type) { if (type == null || type instanceof Type.ErrorType || type instanceof Type.PackageType || type instanceof Type.UnknownType || type instanceof NullType) { return JavaType.Class.Unknown.getInstance(); @@ -464,7 +464,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(com.sun.tools.javac.code.@Nullable Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.Kind.ERR || symbol.type instanceof Type.UnknownType) { return null; } diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java index 9e39d0cc5c2..7f799f8174c 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java @@ -47,7 +47,7 @@ class ReloadableJava8TypeMapping implements JavaTypeMapping { private final JavaTypeCache typeCache; - public JavaType type(@Nullable com.sun.tools.javac.code.Type type) { + public JavaType type(com.sun.tools.javac.code.@Nullable Type type) { if (type == null || type instanceof Type.ErrorType || type instanceof Type.PackageType || type instanceof Type.UnknownType || type instanceof NullType) { return JavaType.Class.Unknown.getInstance(); @@ -447,7 +447,7 @@ public JavaType.Primitive primitive(TypeTag tag) { * @param symbol The method symbol. * @return Method type attribution. */ - public JavaType.@Nullable Method methodInvocationType(@Nullable com.sun.tools.javac.code.Type selectType, @Nullable Symbol symbol) { + public JavaType.@Nullable Method methodInvocationType(com.sun.tools.javac.code.@Nullable Type selectType, @Nullable Symbol symbol) { if (selectType == null || selectType instanceof Type.ErrorType || symbol == null || symbol.kind == Kinds.ERR || symbol.type instanceof Type.UnknownType) { return null; } From ef38bd4589c88e444035da587bf11a122aa6e118 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 00:51:27 -0400 Subject: [PATCH 03/11] Fix NullUtils --- .../main/java/org/openrewrite/internal/lang/NullUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java index 2d989f5b31c..12ea35247c1 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java @@ -125,6 +125,12 @@ private static boolean fieldHasNonNullableAnnotation(Field field) { return true; } } + for (Annotation a : field.getAnnotatedType().getDeclaredAnnotations()) { + String simpleName = a.annotationType().getSimpleName(); + if (FIELD_LEVEL_NON_NULL_ANNOTATIONS.contains(simpleName)) { + return true; + } + } return false; } From e55c15a9108ccf69e3e6d44cb9e3bd9a46abb9db Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 00:53:36 -0400 Subject: [PATCH 04/11] Fix compilation --- .../java/isolated/ReloadableJava11ParserVisitor.java | 2 +- .../java/isolated/ReloadableJava17ParserVisitor.java | 2 +- .../java/isolated/ReloadableJava21ParserVisitor.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java index ec500c8326e..1932dc4319c 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11ParserVisitor.java @@ -2062,7 +2062,7 @@ private List collectAnnotations(Map annotat return annotations; } - Space formatWithCommentTree(String prefix, JCTree tree, @Nullable DCTree.DCDocComment commentTree) { + Space formatWithCommentTree(String prefix, JCTree tree, DCTree.@Nullable DCDocComment commentTree) { Space fmt = format(prefix); if (commentTree != null) { List comments = fmt.getComments(); diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java index 64fff05cdb2..f13b73efcfb 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17ParserVisitor.java @@ -2139,7 +2139,7 @@ private List collectAnnotations(Map annotat return annotations; } - Space formatWithCommentTree(String prefix, JCTree tree, @Nullable DCTree.DCDocComment commentTree) { + Space formatWithCommentTree(String prefix, JCTree tree, DCTree.@Nullable DCDocComment commentTree) { Space fmt = format(prefix); if (commentTree != null) { List comments = fmt.getComments(); diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java index 6cc08b4e0bc..5079764cb0b 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21ParserVisitor.java @@ -2136,7 +2136,7 @@ private List collectAnnotations(Map annotat return annotations; } - Space formatWithCommentTree(String prefix, JCTree tree, @Nullable DCTree.DCDocComment commentTree) { + Space formatWithCommentTree(String prefix, JCTree tree, DCTree.@Nullable DCDocComment commentTree) { Space fmt = format(prefix); if (commentTree != null) { List comments = fmt.getComments(); From fa4f568dd71f10590da9beab8bfbe210eefc6668 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 00:59:30 -0400 Subject: [PATCH 05/11] Compilation --- .../java/isolated/ReloadableJava11JavadocVisitor.java | 3 +-- .../java/isolated/ReloadableJava17JavadocVisitor.java | 3 +-- .../java/isolated/ReloadableJava21JavadocVisitor.java | 3 +-- .../org/openrewrite/java/ReloadableJava8JavadocVisitor.java | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java index 97a6c232ccd..3e4b82c9bce 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11JavadocVisitor.java @@ -49,8 +49,7 @@ public class ReloadableJava11JavadocVisitor extends DocTreeScanner> { private final Attr attr; - @Nullable - private final Symbol.TypeSymbol symbol; + private final Symbol.@Nullable TypeSymbol symbol; @Nullable private final Type enclosingClassType; diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java index 96bff715540..88a4949b7b1 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17JavadocVisitor.java @@ -52,8 +52,7 @@ public class ReloadableJava17JavadocVisitor extends DocTreeScanner> { private final Attr attr; - @Nullable - private final Symbol.TypeSymbol symbol; + private final Symbol.@Nullable TypeSymbol symbol; @Nullable private final Type enclosingClassType; diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java index 99d15a63af9..ea212f06622 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21JavadocVisitor.java @@ -52,8 +52,7 @@ public class ReloadableJava21JavadocVisitor extends DocTreeScanner> { private final Attr attr; - @Nullable - private final Symbol.TypeSymbol symbol; + private final Symbol.@Nullable TypeSymbol symbol; @Nullable private final Type enclosingClassType; diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java index c3d34d2fcdc..fc1dc3eabba 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8JavadocVisitor.java @@ -49,7 +49,6 @@ public class ReloadableJava8JavadocVisitor extends DocTreeScanner> { private final Attr attr; - private final Symbol.@Nullable TypeSymbol symbol; @Nullable From 151aac89796e62f81e34b516025e1b4c208b0eda Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 01:03:47 -0400 Subject: [PATCH 06/11] Compilation --- .../java/org/openrewrite/gradle/trait/GradleDependency.java | 2 +- .../java/org/openrewrite/groovy/GroovyTypeMappingTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java index c5e41fec132..901543431e0 100644 --- a/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java +++ b/rewrite-gradle/src/main/java/org/openrewrite/gradle/trait/GradleDependency.java @@ -119,7 +119,7 @@ public Matcher artifactId(String artifactId) { return null; } - private @Nullable org.openrewrite.gradle.util.Dependency parseDependency(List arguments) { + private org.openrewrite.gradle.util.@Nullable Dependency parseDependency(List arguments) { Expression argument = arguments.get(0); if (argument instanceof J.Literal) { return DependencyStringNotationConverter.parse((String) ((J.Literal) argument).getValue()); diff --git a/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java b/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java index a1fbeb1129c..8806d3e76d6 100644 --- a/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java +++ b/rewrite-groovy/src/test/java/org/openrewrite/groovy/GroovyTypeMappingTest.java @@ -77,10 +77,10 @@ void noDuplicateSignatures() { new GroovyVisitor() { @Override - public org.openrewrite.java.tree.JavaType visitType(@Nullable org.openrewrite.java.tree.JavaType javaType, Integer p) { + public org.openrewrite.java.tree.JavaType visitType(org.openrewrite.java.tree.@Nullable JavaType javaType, Integer p) { return new JavaTypeVisitor() { @Override - public org.openrewrite.java.tree.JavaType visit(@Nullable org.openrewrite.java.tree.JavaType javaType, Integer p) { + public org.openrewrite.java.tree.JavaType visit(org.openrewrite.java.tree.@Nullable JavaType javaType, Integer p) { if (javaType != null) { if (uniqueTypes.add(javaType)) { typeBySignatureAfterMapping.compute(javaType.toString(), (t, existing) -> { From c596f44d70512de98aaa2e18e5ceaf91f2eb9245 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 01:06:02 -0400 Subject: [PATCH 07/11] Compilation --- .../java/isolated/ReloadableJava11TypeMapping.java | 2 +- .../java/isolated/ReloadableJava17TypeMapping.java | 2 +- .../java/isolated/ReloadableJava21TypeMapping.java | 4 ++-- .../java/org/openrewrite/java/ReloadableJava8TypeMapping.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java index 2b55dee5862..577e2deb923 100644 --- a/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java +++ b/rewrite-java-11/src/main/java/org/openrewrite/java/isolated/ReloadableJava11TypeMapping.java @@ -152,7 +152,7 @@ private JavaType mapElements(JavaType elementType, List trees) { ); } - private @Nullable JavaType.FullyQualified[] mapAnnotations(List annotations) { + private JavaType.@Nullable FullyQualified[] mapAnnotations(List annotations) { List types = new ArrayList<>(annotations.size()); for (JCTree.JCAnnotation annotation : annotations) { JavaType.FullyQualified fq = TypeUtils.asFullyQualified(type(annotation)); diff --git a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java index 65bc3847ea7..035f87f570b 100644 --- a/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java +++ b/rewrite-java-17/src/main/java/org/openrewrite/java/isolated/ReloadableJava17TypeMapping.java @@ -149,7 +149,7 @@ private JavaType mapElements(JavaType elementType, List trees) { ); } - private @Nullable JavaType.FullyQualified[] mapAnnotations(List annotations) { + private JavaType.@Nullable FullyQualified[] mapAnnotations(List annotations) { List types = new ArrayList<>(annotations.size()); for (JCTree.JCAnnotation annotation : annotations) { JavaType.FullyQualified fq = TypeUtils.asFullyQualified(type(annotation)); diff --git a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java index c9fe0371d3b..30e63951d90 100644 --- a/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java +++ b/rewrite-java-21/src/main/java/org/openrewrite/java/isolated/ReloadableJava21TypeMapping.java @@ -149,7 +149,7 @@ private JavaType mapElements(JavaType elementType, List trees) { ); } - private @Nullable JavaType.FullyQualified[] mapAnnotations(List annotations) { + private JavaType.@Nullable FullyQualified[] mapAnnotations(List annotations) { List types = new ArrayList<>(annotations.size()); for (JCTree.JCAnnotation annotation : annotations) { JavaType.FullyQualified fq = TypeUtils.asFullyQualified(type(annotation)); @@ -160,7 +160,7 @@ private JavaType mapElements(JavaType elementType, List trees) { return types.toArray(new JavaType.FullyQualified[0]); } - private @Nullable JavaType.FullyQualified[] mapAnnotations(Type type) { + private JavaType.@Nullable FullyQualified[] mapAnnotations(Type type) { if (!type.isAnnotated()) { return null; } diff --git a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java index 7f799f8174c..81161725c50 100644 --- a/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java +++ b/rewrite-java-8/src/main/java/org/openrewrite/java/ReloadableJava8TypeMapping.java @@ -153,7 +153,7 @@ private JavaType mapElements(JavaType elementType, List trees) { ); } - private @Nullable JavaType.FullyQualified[] mapAnnotations(List annotations) { + private JavaType.@Nullable FullyQualified[] mapAnnotations(List annotations) { List types = new ArrayList<>(annotations.size()); for (JCTree.JCAnnotation annotation : annotations) { JavaType.FullyQualified fq = TypeUtils.asFullyQualified(type(annotation)); From ef6e8c3b5317dfad0729f38e0ca77e06d24de941 Mon Sep 17 00:00:00 2001 From: Jonathan Schneider Date: Thu, 15 Aug 2024 01:30:59 -0400 Subject: [PATCH 08/11] OpenRewrite non-null isn't runtime enforced --- .../src/main/java/org/openrewrite/CreateFileVisitor.java | 2 +- .../java/org/openrewrite/internal/RecipeIntrospectionUtils.java | 2 +- .../src/main/java/org/openrewrite/internal/StringUtils.java | 2 +- .../src/main/java/org/openrewrite/internal/lang/NonNullApi.java | 2 +- .../src/main/java/org/openrewrite/internal/lang/NullUtils.java | 2 +- .../src/main/java/org/openrewrite/internal/lang/Nullable.java | 2 +- .../java/org/openrewrite/marker/OperatingSystemProvenance.java | 2 +- .../src/main/java/org/openrewrite/text/FindAndReplace.java | 2 +- .../test/java/org/openrewrite/config/DeclarativeRecipeTest.java | 2 +- .../org/openrewrite/internal/lang/nullable/NonNullTest.java | 2 +- .../java/org/openrewrite/gradle/util/GradleWrapperTest.java | 2 +- .../main/java/org/openrewrite/groovy/GroovyParserVisitor.java | 2 +- .../java/org/openrewrite/hcl/internal/HclParserVisitor.java | 2 +- .../java/org/openrewrite/java/ChangeStaticFieldToMethod.java | 2 +- .../main/java/org/openrewrite/java/RemoveAnnotationVisitor.java | 2 +- .../openrewrite/java/ShortenFullyQualifiedTypeReferences.java | 2 +- .../openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java | 2 +- .../main/java/org/openrewrite/java/style/EmptyBlockStyle.java | 2 +- .../main/java/org/openrewrite/java/style/OperatorWrapStyle.java | 2 +- rewrite-java/src/main/java/org/openrewrite/java/tree/J.java | 2 +- .../src/main/java/org/openrewrite/maven/internal/RawPom.java | 2 +- .../src/main/java/org/openrewrite/test/RewriteTest.java | 2 +- .../openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java b/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java index 8a295913529..c64558009c8 100644 --- a/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java +++ b/rewrite-core/src/main/java/org/openrewrite/CreateFileVisitor.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import java.nio.file.Path; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java index cc543aad6dc..8faa555adfa 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/RecipeIntrospectionUtils.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.config.ColumnDescriptor; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java index bdeaaa07585..2bf82f699a4 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/StringUtils.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import java.io.ByteArrayOutputStream; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java index b56521a5c13..b2c6109f781 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NonNullApi.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal.lang; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java index 12ea35247c1..ea667d09699 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/NullUtils.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal.lang; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.openrewrite.Option; import java.lang.annotation.Annotation; diff --git a/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java b/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java index 2316168449a..0c455f1ec9a 100644 --- a/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java +++ b/rewrite-core/src/main/java/org/openrewrite/internal/lang/Nullable.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal.lang; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.NullMarked; import javax.annotation.meta.TypeQualifierNickname; diff --git a/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java b/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java index ac5c3cad193..f23099e8301 100644 --- a/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java +++ b/rewrite-core/src/main/java/org/openrewrite/marker/OperatingSystemProvenance.java @@ -22,7 +22,7 @@ import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.With; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; diff --git a/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java b/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java index 0842da78a57..a1da2de1b74 100644 --- a/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java +++ b/rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.binary.Binary; diff --git a/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java b/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java index a70b9c7701d..4b347b23031 100644 --- a/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/config/DeclarativeRecipeTest.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import org.openrewrite.*; diff --git a/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java b/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java index 60388bc75af..d93a093652f 100644 --- a/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java +++ b/rewrite-core/src/test/java/org/openrewrite/internal/lang/nullable/NonNullTest.java @@ -15,7 +15,7 @@ */ package org.openrewrite.internal.lang.nullable; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; @SuppressWarnings("ALL") public class NonNullTest { diff --git a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java index 21d47b90b5e..760feadd82a 100644 --- a/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java +++ b/rewrite-gradle/src/test/java/org/openrewrite/gradle/util/GradleWrapperTest.java @@ -21,7 +21,7 @@ import okhttp3.mockwebserver.MockResponse; import okhttp3.mockwebserver.MockWebServer; import okhttp3.mockwebserver.RecordedRequest; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.openrewrite.internal.StringUtils; import java.io.IOException; diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java index da9789e138c..1fc101f04bd 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyParserVisitor.java @@ -25,7 +25,7 @@ import org.codehaus.groovy.ast.stmt.*; import org.codehaus.groovy.control.SourceUnit; import org.codehaus.groovy.transform.stc.StaticTypesMarker; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.Cursor; import org.openrewrite.ExecutionContext; diff --git a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java index c8c221a8ad6..9eb2dbc35f3 100644 --- a/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java +++ b/rewrite-hcl/src/main/java/org/openrewrite/hcl/internal/HclParserVisitor.java @@ -19,7 +19,7 @@ import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.TerminalNode; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.FileAttributes; import org.openrewrite.hcl.internal.grammar.HCLParser; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java b/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java index 7f83e218494..4aa2f34960d 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ChangeStaticFieldToMethod.java @@ -19,7 +19,7 @@ import lombok.Value; import org.apache.commons.lang3.StringUtils; import org.intellij.lang.annotations.Language; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.java.search.UsesField; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java index ecba536f14b..423fb41c23c 100755 --- a/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/RemoveAnnotationVisitor.java @@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode; import lombok.Value; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.openrewrite.ExecutionContext; import org.openrewrite.internal.ListUtils; import org.openrewrite.java.tree.*; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java b/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java index d8907ed52c9..f457d298cd0 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ShortenFullyQualifiedTypeReferences.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java index 9ae6fdd6e01..4f786477da3 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/format/NormalizeTabsOrSpacesVisitor.java @@ -15,7 +15,7 @@ */ package org.openrewrite.java.format; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java b/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java index bd808cc7d50..8a0e4e9b0fc 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/EmptyBlockStyle.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.openrewrite.internal.lang.NullFields; import org.openrewrite.style.Style; import org.openrewrite.style.StyleHelper; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java b/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java index cc88978e76d..4bd3006ecbf 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/style/OperatorWrapStyle.java @@ -17,7 +17,7 @@ import lombok.Value; import lombok.With; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.openrewrite.internal.lang.NullFields; import org.openrewrite.style.Style; import org.openrewrite.style.StyleHelper; diff --git a/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java b/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java index 7ac3ec7b452..9ea13f6e1db 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/tree/J.java @@ -19,7 +19,7 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.internal.ListUtils; diff --git a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java index 4befdcfd431..c794ad3c99f 100755 --- a/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java +++ b/rewrite-maven/src/main/java/org/openrewrite/maven/internal/RawPom.java @@ -23,7 +23,7 @@ import lombok.*; import lombok.experimental.FieldDefaults; import lombok.experimental.NonFinal; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.internal.StringUtils; import org.openrewrite.maven.tree.*; diff --git a/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java b/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java index 11a41feb255..3e3bdc87f26 100644 --- a/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java +++ b/rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java @@ -18,7 +18,7 @@ import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; import org.assertj.core.api.SoftAssertions; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.*; import org.openrewrite.config.CompositeRecipe; diff --git a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java index 3251f773774..e942cb28c6a 100644 --- a/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java +++ b/rewrite-xml/src/main/java/org/openrewrite/xml/format/NormalizeTabsOrSpacesVisitor.java @@ -15,7 +15,7 @@ */ package org.openrewrite.xml.format; -import org.jspecify.annotations.NonNull; +import org.openrewrite.internal.lang.NonNull; import org.jspecify.annotations.Nullable; import org.openrewrite.Tree; import org.openrewrite.internal.StringUtils; From b6d9c1f677c169a6c9dcb1a4c125151c4e69ba2f Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Thu, 15 Aug 2024 08:43:47 +0200 Subject: [PATCH 09/11] Use OpenRewrite's `@Nullable` for `ReorderMethodArguments` --- .../main/java/org/openrewrite/java/ReorderMethodArguments.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java index ab1432ef699..a13bf2fb8e9 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import lombok.EqualsAndHashCode; import lombok.Value; -import org.jspecify.annotations.Nullable; import org.openrewrite.*; +import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.DeclaresMethod; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; From f2d87953636d8a079491f52b14387b6e499ebea0 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Thu, 15 Aug 2024 08:51:09 +0200 Subject: [PATCH 10/11] Move JSpecify annotation to correct place --- .../java/org/openrewrite/java/ReorderMethodArguments.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java index a13bf2fb8e9..1b11a35940a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java @@ -18,8 +18,8 @@ import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import lombok.EqualsAndHashCode; import lombok.Value; +import org.jspecify.annotations.Nullable; import org.openrewrite.*; -import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.search.DeclaresMethod; import org.openrewrite.java.search.UsesMethod; import org.openrewrite.java.tree.*; @@ -63,8 +63,7 @@ public class ReorderMethodArguments extends Recipe { description = "If the original method signature is not type-attributed, this is an optional list that indicates the original order in which the arguments were arranged.", required = false, example = "[baz, bar, foo]") - @Nullable - String[] oldParameterNames; + String @Nullable[] oldParameterNames; @Option(displayName = "Ignore type definition", description = "When set to `true` the definition of the old type will be left untouched. " + From 251c7d06603abe9d0657f80704071f41ebe1a079 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Thu, 15 Aug 2024 08:52:37 +0200 Subject: [PATCH 11/11] Reformat --- .../main/java/org/openrewrite/java/ReorderMethodArguments.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java index 1b11a35940a..b6e0ffb5c6c 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/ReorderMethodArguments.java @@ -63,7 +63,7 @@ public class ReorderMethodArguments extends Recipe { description = "If the original method signature is not type-attributed, this is an optional list that indicates the original order in which the arguments were arranged.", required = false, example = "[baz, bar, foo]") - String @Nullable[] oldParameterNames; + String @Nullable [] oldParameterNames; @Option(displayName = "Ignore type definition", description = "When set to `true` the definition of the old type will be left untouched. " +