From f5df6dc87e12c087e67dacf55d51873196d5b896 Mon Sep 17 00:00:00 2001 From: modmuss Date: Mon, 10 Nov 2025 09:42:51 +0000 Subject: [PATCH] JSpecify, package-info's and misc null fixes. (#1443) * jspecify * Null fixes + package infos * Unit test fixes --- build.gradle | 3 +- checkstyle.xml | 4 + gradle/package-info.gradle | 91 +++++++++++++++++++ .../loom/LoomCompanionGradlePlugin.java | 3 +- .../fabricmc/loom/LoomRepositoryPlugin.java | 3 +- .../loom/api/RemapConfigurationSettings.java | 3 +- .../loom/api/decompilers/package-info.java | 28 ++++++ .../loom/api/fabricapi/package-info.java | 28 ++++++ .../fabricmc/loom/api/fmj/package-info.java | 28 ++++++ .../loom/api/manifest/package-info.java | 28 ++++++ .../mappings/intermediate/package-info.java | 28 ++++++ .../mappings/layered/MappingsNamespace.java | 2 +- .../api/mappings/layered/package-info.java | 28 ++++++ .../mappings/layered/spec/package-info.java | 28 ++++++ .../net/fabricmc/loom/api/package-info.java | 28 ++++++ .../api/processor/MinecraftJarProcessor.java | 2 +- .../loom/api/processor/package-info.java | 28 ++++++ .../api/remapping/TinyRemapperExtension.java | 20 ++-- .../loom/api/remapping/package-info.java | 28 ++++++ .../loom/build/mixin/package-info.java | 28 ++++++ .../nesting/NestableJarGenerationTask.java | 2 +- .../loom/build/nesting/package-info.java | 28 ++++++ .../configuration/CompileConfiguration.java | 3 +- .../configuration/DebofInstallerData.java | 2 +- .../accesswidener/AccessWidenerEntry.java | 2 +- .../AccessWidenerJarProcessor.java | 4 +- .../LocalAccessWidenerEntry.java | 2 +- .../accesswidener/ModAccessWidenerEntry.java | 2 +- .../accesswidener/package-info.java | 28 ++++++ .../classpathgroups/package-info.java | 28 ++++++ .../configuration/decompile/package-info.java | 28 ++++++ .../configuration/fabricapi/package-info.java | 28 ++++++ .../ide/idea/DownloadSourcesHook.java | 5 +- .../configuration/ide/idea/package-info.java | 28 ++++++ .../loom/configuration/ide/package-info.java | 28 ++++++ .../InterfaceInjectionProcessor.java | 4 +- .../ifaceinject/package-info.java | 28 ++++++ .../configuration/mods/ArtifactMetadata.java | 2 +- .../loom/configuration/mods/ArtifactRef.java | 2 +- .../loom/configuration/mods/JarSplitter.java | 2 +- .../mods/ModConfigurationRemapper.java | 4 +- .../mods/dependency/LocalMavenHelper.java | 2 +- .../mods/dependency/ModDependency.java | 2 +- .../mods/dependency/ModDependencyFactory.java | 2 +- .../mods/dependency/SimpleModDependency.java | 2 +- .../mods/dependency/SplitModDependency.java | 2 +- .../mods/dependency/package-info.java | 28 ++++++ .../mods/dependency/refmap/package-info.java | 28 ++++++ .../mods/extension/package-info.java | 28 ++++++ .../loom/configuration/mods/package-info.java | 28 ++++++ .../loom/configuration/package-info.java | 28 ++++++ .../processors/LegacyJarProcessorWrapper.java | 4 +- .../MinecraftJarProcessorManager.java | 4 +- .../processors/ModJavadocProcessor.java | 4 +- .../processors/package-info.java | 28 ++++++ .../speccontext/RemappedSpecContext.java | 2 +- .../processors/speccontext/package-info.java | 28 ++++++ .../providers/BundleMetadata.java | 2 +- .../IntermediaryMappingsProvider.java | 5 +- .../IntermediateMappingsProviderInternal.java | 2 +- .../mappings/LayeredMappingsProcessor.java | 5 +- .../mappings/MappingConfiguration.java | 2 +- .../NoOpIntermediateMappingsProvider.java | 4 +- .../mappings/TinyMappingsService.java | 2 +- .../annotations/AnnotationNodeSerializer.java | 2 +- .../extras/annotations/AnnotationsData.java | 2 +- .../extras/annotations/AnnotationsLayer.java | 2 +- .../annotations/ClassAnnotationData.java | 2 +- .../extras/annotations/TypeAnnotationKey.java | 2 +- .../extras/annotations/package-info.java | 28 ++++++ .../validate/AnnotationsDataValidator.java | 2 +- .../validate/TypePathCheckerVisitor.java | 2 +- .../annotations/validate/package-info.java | 28 ++++++ .../extras/signatures/package-info.java | 28 ++++++ .../mappings/extras/unpick/UnpickLayer.java | 2 +- .../mappings/extras/unpick/package-info.java | 28 ++++++ .../mappings/file/FileMappingsLayer.java | 2 +- .../providers/mappings/file/package-info.java | 28 ++++++ .../mappings/intermediary/package-info.java | 28 ++++++ .../mappings/mojmap/MojangMappingLayer.java | 2 +- .../mappings/mojmap/package-info.java | 28 ++++++ .../providers/mappings/package-info.java | 28 ++++++ .../mappings/parchment/ParchmentTreeV1.java | 2 +- .../mappings/parchment/package-info.java | 28 ++++++ .../tiny/UnobfuscatedMappingNsCompleter.java | 2 +- .../providers/mappings/tiny/package-info.java | 28 ++++++ .../mappings/unpick/UnpickMetadata.java | 2 +- .../mappings/unpick/package-info.java | 28 ++++++ .../mappings/utils/package-info.java | 28 ++++++ .../minecraft/AnnotationsApplyVisitor.java | 2 +- .../minecraft/MinecraftMetadataProvider.java | 2 +- .../minecraft/MinecraftProvider.java | 2 +- .../minecraft/MinecraftVersionMeta.java | 2 +- .../providers/minecraft/VersionsManifest.java | 2 +- .../minecraft/assets/package-info.java | 28 ++++++ .../providers/minecraft/library/Library.java | 2 +- .../minecraft/library/package-info.java | 28 ++++++ .../library/processors/package-info.java | 28 ++++++ .../minecraft/mapped/package-info.java | 28 ++++++ .../providers/minecraft/package-info.java | 28 ++++++ .../minecraft/verify/CertificateChain.java | 4 +- .../minecraft/verify/package-info.java | 28 ++++++ .../configuration/providers/package-info.java | 28 ++++++ .../configuration/sandbox/package-info.java | 28 ++++++ .../loom/decompilers/ClassLineNumbers.java | 2 +- .../loom/decompilers/cache/CachedData.java | 4 +- .../decompilers/cache/CachedFileStore.java | 2 +- .../cache/CachedFileStoreImpl.java | 2 +- .../decompilers/cache/CachedJarProcessor.java | 2 +- .../loom/decompilers/cache/package-info.java | 28 ++++++ .../loom/decompilers/package-info.java | 28 ++++++ .../loom/extension/MixinExtension.java | 7 +- .../loom/extension/MixinExtensionImpl.java | 5 - .../extension/RemapperExtensionHolder.java | 2 +- .../fabricmc/loom/extension/package-info.java | 28 ++++++ .../java/net/fabricmc/loom/package-info.java | 28 ++++++ .../fabricmc/loom/task/AbstractRunTask.java | 11 +-- .../loom/task/GenerateSourcesTask.java | 4 +- .../net/fabricmc/loom/task/LoomTasks.java | 5 +- .../loom/task/ManifestModificationAction.java | 3 +- .../fabricmc/loom/task/NestJarsAction.java | 3 +- .../net/fabricmc/loom/task/RemapJarTask.java | 2 +- .../loom/task/ValidateMixinNameTask.java | 2 +- .../loom/task/launch/package-info.java | 28 ++++++ .../net/fabricmc/loom/task/package-info.java | 28 ++++++ .../fabricmc/loom/task/prod/package-info.java | 28 ++++++ .../task/service/MixinAPMappingService.java | 2 +- .../task/service/SourceMappingsService.java | 2 +- .../task/service/TinyRemapperService.java | 2 +- .../loom/task/service/UnpickService.java | 2 +- .../loom/task/service/package-info.java | 28 ++++++ .../fabricmc/loom/task/tool/package-info.java | 28 ++++++ .../java/net/fabricmc/loom/util/Checksum.java | 3 +- .../java/net/fabricmc/loom/util/Lazy.java | 2 +- .../java/net/fabricmc/loom/util/ZipUtils.java | 2 +- .../GradleDownloadProgressListener.java | 2 +- .../loom/util/download/package-info.java | 28 ++++++ .../fabricmc/loom/util/fmj/FabricModJson.java | 2 +- .../loom/util/fmj/FabricModJsonFactory.java | 2 +- .../loom/util/fmj/FabricModJsonV0.java | 2 +- .../loom/util/fmj/FabricModJsonV1.java | 2 +- .../loom/util/fmj/FabricModJsonV2.java | 2 +- .../loom/util/fmj/gen/package-info.java | 28 ++++++ .../util/fmj/mixin/MixinConfiguration.java | 2 +- .../loom/util/fmj/mixin/package-info.java | 28 ++++++ .../fabricmc/loom/util/fmj/package-info.java | 28 ++++++ .../loom/util/gradle/SourceSetHelper.java | 2 +- .../loom/util/gradle/daemon/DaemonUtils.java | 2 +- .../loom/util/gradle/daemon/package-info.java | 28 ++++++ .../loom/util/gradle/package-info.java | 28 ++++++ .../fabricmc/loom/util/ipc/package-info.java | 28 ++++++ .../loom/util/kotlin/package-info.java | 28 ++++++ .../net/fabricmc/loom/util/package-info.java | 28 ++++++ .../loom/util/service/ServiceFactory.java | 2 +- .../loom/util/service/package-info.java | 28 ++++++ .../processor/AnnotationsApplyTest.groovy | 9 +- .../TypePathCheckerVisitorTest.groovy | 2 +- .../loom/test/util/GradleTestUtil.groovy | 2 +- .../fabricmc/loom/test/unit/package-info.java | 28 ++++++ .../unit/processor/classes/package-info.java | 28 ++++++ .../loom/test/unit/sandbox/package-info.java | 28 ++++++ 161 files changed, 2117 insertions(+), 146 deletions(-) create mode 100644 gradle/package-info.gradle create mode 100644 src/main/java/net/fabricmc/loom/api/decompilers/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/fabricapi/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/fmj/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/manifest/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/mappings/intermediate/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/mappings/layered/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/mappings/layered/spec/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/processor/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/api/remapping/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/build/mixin/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/build/nesting/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/accesswidener/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/classpathgroups/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/decompile/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/fabricapi/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/ide/idea/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/ide/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/ifaceinject/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/mods/dependency/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/mods/dependency/refmap/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/mods/extension/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/mods/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/processors/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/processors/speccontext/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/signatures/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/intermediary/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/mappings/utils/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/minecraft/assets/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/processors/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/minecraft/mapped/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/minecraft/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/providers/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/configuration/sandbox/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/decompilers/cache/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/decompilers/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/extension/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/task/launch/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/task/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/task/prod/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/task/service/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/task/tool/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/download/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/fmj/gen/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/fmj/mixin/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/fmj/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/gradle/daemon/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/gradle/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/ipc/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/kotlin/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/package-info.java create mode 100644 src/main/java/net/fabricmc/loom/util/service/package-info.java create mode 100644 src/test/java/net/fabricmc/loom/test/unit/package-info.java create mode 100644 src/test/java/net/fabricmc/loom/test/unit/processor/classes/package-info.java create mode 100644 src/test/java/net/fabricmc/loom/test/unit/sandbox/package-info.java diff --git a/build.gradle b/build.gradle index 71e29c4a..d710e407 100644 --- a/build.gradle +++ b/build.gradle @@ -415,4 +415,5 @@ abstract class PrintActionsTestName extends DefaultTask { } } -apply from: rootProject.file('gradle/versions.gradle') \ No newline at end of file +apply from: rootProject.file('gradle/versions.gradle') +apply from: rootProject.file('gradle/package-info.gradle') \ No newline at end of file diff --git a/checkstyle.xml b/checkstyle.xml index 279b740b..3783b8f0 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -74,6 +74,10 @@ + + + + diff --git a/gradle/package-info.gradle b/gradle/package-info.gradle new file mode 100644 index 00000000..a0a11bd3 --- /dev/null +++ b/gradle/package-info.gradle @@ -0,0 +1,91 @@ +import java.nio.file.Files + +for (def sourceSet in [ + sourceSets.main, + sourceSets.test +]) { + def sourceSetName = sourceSet.name + def taskName = sourceSet.getTaskName('generate', 'PackageInfos') + tasks.register(taskName, GeneratePackageInfos) { + description = "Generates package-info files for $sourceSetName packages." + sourceRoot = file("src/$sourceSetName/java") + header = rootProject.file('HEADER') + } + + def checkTask = tasks.register(sourceSet.getTaskName('check', 'PackageInfos'), CheckPackageInfos) { + description = "Checks that all $sourceSetName packages have package-info files." + sourceRoot = file("src/$sourceSetName/java") + } + tasks.check.dependsOn checkTask +} + +abstract class GeneratePackageInfos extends DefaultTask { + @InputFile + File header + + @InputDirectory + abstract DirectoryProperty getSourceRoot() + + GeneratePackageInfos() { + } + + @TaskAction + def run() { + def headerText = header.readLines().join("\n") // normalize line endings + def root = sourceRoot.get().asFile.toPath() + + root.eachDirRecurse { + def containsJava = Files.list(it).any { + Files.isRegularFile(it) && it.fileName.toString().endsWith('.java') + } + + if (!containsJava) { + return + } + + def relativePath = root.relativize(it) + def packageName = relativePath.toString().replace(File.separator, '.') + String year = Calendar.getInstance().get(Calendar.YEAR).toString() + + it.resolve('package-info.java').withWriter { + it.write("""$headerText + |@NullMarked + |package $packageName; + | + |import org.jspecify.annotations.NullMarked; + |""".replace("\$YEAR", year).stripMargin()) + } + } + } +} + +abstract class CheckPackageInfos extends DefaultTask { + @InputDirectory + abstract DirectoryProperty getSourceRoot() + + @TaskAction + def run() { + def root = sourceRoot.get().asFile.toPath() + def errors = [] + + root.eachDirRecurse { + def containsJava = Files.list(it).any { + Files.isRegularFile(it) && it.fileName.toString().endsWith('.java') + } + + if (!containsJava) { + return + } + + def packageInfoPath = it.resolve('package-info.java') + if (!Files.exists(packageInfoPath)) { + errors << "Missing package-info.java in package: " + root.relativize(it).toString().replace(File.separator, '.') + return + } + } + + if (!errors.isEmpty()) { + throw new GradleException("Package info check failed:\n" + errors.join("\n")) + } + } +} \ No newline at end of file diff --git a/src/main/java/net/fabricmc/loom/LoomCompanionGradlePlugin.java b/src/main/java/net/fabricmc/loom/LoomCompanionGradlePlugin.java index 18a6ca99..b3e14661 100644 --- a/src/main/java/net/fabricmc/loom/LoomCompanionGradlePlugin.java +++ b/src/main/java/net/fabricmc/loom/LoomCompanionGradlePlugin.java @@ -26,7 +26,6 @@ package net.fabricmc.loom; import org.gradle.api.Plugin; import org.gradle.api.Project; -import org.jetbrains.annotations.NotNull; import net.fabricmc.loom.configuration.LoomConfigurations; import net.fabricmc.loom.task.launch.ExportClasspathTask; @@ -36,7 +35,7 @@ public class LoomCompanionGradlePlugin implements Plugin { public static final String NAME = "net.fabricmc.fabric-loom-companion"; @Override - public void apply(@NotNull Project project) { + public void apply(Project project) { var exportClassPathTask = project.getTasks().register(Constants.Task.EXPORT_CLASSPATH, ExportClasspathTask.class); project.getConfigurations().register(Constants.Configurations.EXPORTED_CLASSPATH, LoomConfigurations.Role.CONSUMABLE::apply); project.artifacts(artifactHandler -> artifactHandler.add(Constants.Configurations.EXPORTED_CLASSPATH, exportClassPathTask)); diff --git a/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java b/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java index 896c72df..1709db94 100644 --- a/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java +++ b/src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java @@ -34,14 +34,13 @@ import org.gradle.api.initialization.Settings; import org.gradle.api.invocation.Gradle; import org.gradle.api.plugins.ExtensionAware; import org.gradle.api.plugins.PluginAware; -import org.jetbrains.annotations.NotNull; import net.fabricmc.loom.extension.LoomFiles; import net.fabricmc.loom.util.MirrorUtil; public class LoomRepositoryPlugin implements Plugin { @Override - public void apply(@NotNull PluginAware target) { + public void apply(PluginAware target) { if (target instanceof Settings settings) { declareRepositories(settings.getDependencyResolutionManagement().getRepositories(), LoomFiles.create(settings), settings); diff --git a/src/main/java/net/fabricmc/loom/api/RemapConfigurationSettings.java b/src/main/java/net/fabricmc/loom/api/RemapConfigurationSettings.java index 8ebc3a6d..eb4bfa34 100644 --- a/src/main/java/net/fabricmc/loom/api/RemapConfigurationSettings.java +++ b/src/main/java/net/fabricmc/loom/api/RemapConfigurationSettings.java @@ -38,7 +38,6 @@ import org.gradle.api.provider.Provider; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.SourceSet; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; import net.fabricmc.loom.configuration.providers.minecraft.MinecraftSourceSets; @@ -62,7 +61,7 @@ public abstract class RemapConfigurationSettings implements Named { } @Override - public @NotNull String getName() { + public String getName() { return name; } diff --git a/src/main/java/net/fabricmc/loom/api/decompilers/package-info.java b/src/main/java/net/fabricmc/loom/api/decompilers/package-info.java new file mode 100644 index 00000000..bb664062 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/decompilers/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.decompilers; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/fabricapi/package-info.java b/src/main/java/net/fabricmc/loom/api/fabricapi/package-info.java new file mode 100644 index 00000000..b95e2921 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/fabricapi/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.fabricapi; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/fmj/package-info.java b/src/main/java/net/fabricmc/loom/api/fmj/package-info.java new file mode 100644 index 00000000..fbcefd00 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/fmj/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.fmj; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/manifest/package-info.java b/src/main/java/net/fabricmc/loom/api/manifest/package-info.java new file mode 100644 index 00000000..c1d9ccbe --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/manifest/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.manifest; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/mappings/intermediate/package-info.java b/src/main/java/net/fabricmc/loom/api/mappings/intermediate/package-info.java new file mode 100644 index 00000000..8903b031 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/mappings/intermediate/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.mappings.intermediate; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/mappings/layered/MappingsNamespace.java b/src/main/java/net/fabricmc/loom/api/mappings/layered/MappingsNamespace.java index c264274a..a41261b3 100644 --- a/src/main/java/net/fabricmc/loom/api/mappings/layered/MappingsNamespace.java +++ b/src/main/java/net/fabricmc/loom/api/mappings/layered/MappingsNamespace.java @@ -26,7 +26,7 @@ package net.fabricmc.loom.api.mappings.layered; import java.util.Locale; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * The standard namespaces used by loom. diff --git a/src/main/java/net/fabricmc/loom/api/mappings/layered/package-info.java b/src/main/java/net/fabricmc/loom/api/mappings/layered/package-info.java new file mode 100644 index 00000000..f15a2aee --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/mappings/layered/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.mappings.layered; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/mappings/layered/spec/package-info.java b/src/main/java/net/fabricmc/loom/api/mappings/layered/spec/package-info.java new file mode 100644 index 00000000..0f934004 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/mappings/layered/spec/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.mappings.layered.spec; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/package-info.java b/src/main/java/net/fabricmc/loom/api/package-info.java new file mode 100644 index 00000000..8feed9c4 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/processor/MinecraftJarProcessor.java b/src/main/java/net/fabricmc/loom/api/processor/MinecraftJarProcessor.java index a47d2520..fc47f9da 100644 --- a/src/main/java/net/fabricmc/loom/api/processor/MinecraftJarProcessor.java +++ b/src/main/java/net/fabricmc/loom/api/processor/MinecraftJarProcessor.java @@ -28,7 +28,7 @@ import java.io.IOException; import java.nio.file.Path; import org.gradle.api.Named; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.mappingio.tree.MemoryMappingTree; diff --git a/src/main/java/net/fabricmc/loom/api/processor/package-info.java b/src/main/java/net/fabricmc/loom/api/processor/package-info.java new file mode 100644 index 00000000..975b3691 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/processor/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.processor; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/api/remapping/TinyRemapperExtension.java b/src/main/java/net/fabricmc/loom/api/remapping/TinyRemapperExtension.java index fb68dbc4..3075087d 100644 --- a/src/main/java/net/fabricmc/loom/api/remapping/TinyRemapperExtension.java +++ b/src/main/java/net/fabricmc/loom/api/remapping/TinyRemapperExtension.java @@ -25,7 +25,7 @@ package net.fabricmc.loom.api.remapping; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.tinyremapper.TinyRemapper; @@ -41,8 +41,7 @@ public interface TinyRemapperExtension { * * @return A {@link TinyRemapper.AnalyzeVisitorProvider} or {@code null}. */ - @Nullable - default TinyRemapper.AnalyzeVisitorProvider getAnalyzeVisitorProvider(Context context) { + default TinyRemapper.@Nullable AnalyzeVisitorProvider getAnalyzeVisitorProvider(Context context) { return getAnalyzeVisitorProvider(); } @@ -51,8 +50,7 @@ public interface TinyRemapperExtension { * * @return A {@link TinyRemapper.ApplyVisitorProvider} or {@code null}. */ - @Nullable - default TinyRemapper.ApplyVisitorProvider getPreApplyVisitor(Context context) { + default TinyRemapper.@Nullable ApplyVisitorProvider getPreApplyVisitor(Context context) { return getPreApplyVisitor(); } @@ -61,8 +59,7 @@ public interface TinyRemapperExtension { * * @return A {@link TinyRemapper.ApplyVisitorProvider} or {@code null}. */ - @Nullable - default TinyRemapper.ApplyVisitorProvider getPostApplyVisitor(Context context) { + default TinyRemapper.@Nullable ApplyVisitorProvider getPostApplyVisitor(Context context) { return getPostApplyVisitor(); } @@ -84,8 +81,7 @@ public interface TinyRemapperExtension { * @deprecated Use {@link #getAnalyzeVisitorProvider(Context)} instead. */ @Deprecated(forRemoval = true) - @Nullable - default TinyRemapper.AnalyzeVisitorProvider getAnalyzeVisitorProvider() { + default TinyRemapper.@Nullable AnalyzeVisitorProvider getAnalyzeVisitorProvider() { return null; } @@ -93,8 +89,7 @@ public interface TinyRemapperExtension { * @deprecated Use {@link #getPreApplyVisitor(Context)} instead. */ @Deprecated(forRemoval = true) - @Nullable - default TinyRemapper.ApplyVisitorProvider getPreApplyVisitor() { + default TinyRemapper.@Nullable ApplyVisitorProvider getPreApplyVisitor() { return null; } @@ -102,8 +97,7 @@ public interface TinyRemapperExtension { * @deprecated Use {@link #getPostApplyVisitor(Context)} instead. */ @Deprecated(forRemoval = true) - @Nullable - default TinyRemapper.ApplyVisitorProvider getPostApplyVisitor() { + default TinyRemapper.@Nullable ApplyVisitorProvider getPostApplyVisitor() { return null; } } diff --git a/src/main/java/net/fabricmc/loom/api/remapping/package-info.java b/src/main/java/net/fabricmc/loom/api/remapping/package-info.java new file mode 100644 index 00000000..4fdaf07e --- /dev/null +++ b/src/main/java/net/fabricmc/loom/api/remapping/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.api.remapping; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/build/mixin/package-info.java b/src/main/java/net/fabricmc/loom/build/mixin/package-info.java new file mode 100644 index 00000000..b83dde3a --- /dev/null +++ b/src/main/java/net/fabricmc/loom/build/mixin/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.build.mixin; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/build/nesting/NestableJarGenerationTask.java b/src/main/java/net/fabricmc/loom/build/nesting/NestableJarGenerationTask.java index bd494b81..0b59ee19 100644 --- a/src/main/java/net/fabricmc/loom/build/nesting/NestableJarGenerationTask.java +++ b/src/main/java/net/fabricmc/loom/build/nesting/NestableJarGenerationTask.java @@ -54,7 +54,7 @@ import org.gradle.api.tasks.OutputDirectory; import org.gradle.api.tasks.PathSensitive; import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.TaskAction; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/build/nesting/package-info.java b/src/main/java/net/fabricmc/loom/build/nesting/package-info.java new file mode 100644 index 00000000..70192724 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/build/nesting/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.build.nesting; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java index 2ba1575b..c551b2da 100644 --- a/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java +++ b/src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java @@ -51,7 +51,6 @@ import org.gradle.api.tasks.TaskContainer; import org.gradle.api.tasks.compile.JavaCompile; import org.gradle.api.tasks.javadoc.Javadoc; import org.gradle.api.tasks.testing.Test; -import org.jetbrains.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.InterfaceInjectionExtensionAPI; @@ -195,7 +194,7 @@ public abstract class CompileConfiguration implements Runnable { } // Provide the remapped mc jars - @Nullable IntermediaryMinecraftProvider intermediaryMinecraftProvider = extension.disableObfuscation() ? null : jarConfiguration.createIntermediaryMinecraftProvider(project); + IntermediaryMinecraftProvider intermediaryMinecraftProvider = extension.disableObfuscation() ? null : jarConfiguration.createIntermediaryMinecraftProvider(project); NamedMinecraftProvider namedMinecraftProvider = jarConfiguration.createNamedMinecraftProvider(project); registerGameProcessors(configContext); diff --git a/src/main/java/net/fabricmc/loom/configuration/DebofInstallerData.java b/src/main/java/net/fabricmc/loom/configuration/DebofInstallerData.java index 84ee0f31..091289ce 100644 --- a/src/main/java/net/fabricmc/loom/configuration/DebofInstallerData.java +++ b/src/main/java/net/fabricmc/loom/configuration/DebofInstallerData.java @@ -32,7 +32,7 @@ import java.util.Optional; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java index 8df65dc2..4e914816 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerEntry.java @@ -26,7 +26,7 @@ package net.fabricmc.loom.configuration.accesswidener; import java.io.IOException; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.classtweaker.api.visitor.ClassTweakerVisitor; import net.fabricmc.loom.util.LazyCloseable; diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java index bb7c17f1..a0a2c637 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/AccessWidenerJarProcessor.java @@ -36,7 +36,7 @@ import java.util.List; import javax.inject.Inject; import org.gradle.api.file.RegularFileProperty; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.classtweaker.api.ClassTweaker; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; @@ -61,7 +61,7 @@ public class AccessWidenerJarProcessor implements MinecraftJarProcessor accessWideners = new ArrayList<>(); if (localAccessWidenerProperty.isPresent()) { diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java index c165c52a..06cadb5a 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/LocalAccessWidenerEntry.java @@ -28,7 +28,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.classtweaker.api.ClassTweakerReader; import net.fabricmc.classtweaker.api.visitor.ClassTweakerVisitor; diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java index cf0455e6..5a218f2f 100644 --- a/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/ModAccessWidenerEntry.java @@ -30,7 +30,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.classtweaker.api.ClassTweakerReader; import net.fabricmc.classtweaker.api.visitor.ClassTweakerVisitor; diff --git a/src/main/java/net/fabricmc/loom/configuration/accesswidener/package-info.java b/src/main/java/net/fabricmc/loom/configuration/accesswidener/package-info.java new file mode 100644 index 00000000..94ef4119 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/accesswidener/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.accesswidener; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/classpathgroups/package-info.java b/src/main/java/net/fabricmc/loom/configuration/classpathgroups/package-info.java new file mode 100644 index 00000000..041300b3 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/classpathgroups/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.classpathgroups; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/decompile/package-info.java b/src/main/java/net/fabricmc/loom/configuration/decompile/package-info.java new file mode 100644 index 00000000..fb5632c3 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/decompile/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.decompile; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/fabricapi/package-info.java b/src/main/java/net/fabricmc/loom/configuration/fabricapi/package-info.java new file mode 100644 index 00000000..cde85199 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/fabricapi/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.fabricapi; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/ide/idea/DownloadSourcesHook.java b/src/main/java/net/fabricmc/loom/configuration/ide/idea/DownloadSourcesHook.java index d799b45d..e619bb69 100644 --- a/src/main/java/net/fabricmc/loom/configuration/ide/idea/DownloadSourcesHook.java +++ b/src/main/java/net/fabricmc/loom/configuration/ide/idea/DownloadSourcesHook.java @@ -34,7 +34,7 @@ import java.util.regex.Pattern; import org.gradle.api.Project; import org.gradle.api.Task; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -121,8 +121,7 @@ record DownloadSourcesHook(Project project, Task task) { } // Return the jar type, or null when this jar isnt used by the project - @Nullable - private MinecraftJar.Type getJarType(String name) { + private MinecraftJar.@Nullable Type getJarType(String name) { final LoomGradleExtension extension = LoomGradleExtension.get(project); final NamedMinecraftProvider minecraftProvider = extension.getNamedMinecraftProvider(); final List dependencyTypes = minecraftProvider.getDependencyTypes(); diff --git a/src/main/java/net/fabricmc/loom/configuration/ide/idea/package-info.java b/src/main/java/net/fabricmc/loom/configuration/ide/idea/package-info.java new file mode 100644 index 00000000..9e2ec2dc --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/ide/idea/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.ide.idea; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/ide/package-info.java b/src/main/java/net/fabricmc/loom/configuration/ide/package-info.java new file mode 100644 index 00000000..2cfb4d1a --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/ide/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.ide; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java b/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java index 96005c23..4333a418 100644 --- a/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/ifaceinject/InterfaceInjectionProcessor.java @@ -41,7 +41,7 @@ import javax.inject.Inject; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; @@ -84,7 +84,7 @@ public abstract class InterfaceInjectionProcessor implements MinecraftJarProcess } @Override - public @Nullable InterfaceInjectionProcessor.Spec buildSpec(SpecContext context) { + public InterfaceInjectionProcessor.@Nullable Spec buildSpec(SpecContext context) { List injectedInterfaces = new ArrayList<>(); injectedInterfaces.addAll(InjectedInterface.fromMods(context.localMods())); diff --git a/src/main/java/net/fabricmc/loom/configuration/ifaceinject/package-info.java b/src/main/java/net/fabricmc/loom/configuration/ifaceinject/package-info.java new file mode 100644 index 00000000..80d8ea09 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/ifaceinject/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.ifaceinject; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java index de6e81fd..b13cf33d 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactMetadata.java @@ -36,7 +36,7 @@ import java.util.function.Predicate; import java.util.jar.Attributes; import java.util.jar.Manifest; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.configuration.InstallerData; import net.fabricmc.loom.util.Constants; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactRef.java b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactRef.java index 5a495cf3..c3566023 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactRef.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ArtifactRef.java @@ -35,7 +35,7 @@ import org.gradle.api.artifacts.Dependency; import org.gradle.api.artifacts.ModuleDependency; import org.gradle.api.artifacts.ResolvedArtifact; import org.gradle.api.artifacts.dsl.DependencyHandler; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.util.Checksum; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/JarSplitter.java b/src/main/java/net/fabricmc/loom/configuration/mods/JarSplitter.java index 50cb05c3..8882c2a6 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/JarSplitter.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/JarSplitter.java @@ -41,7 +41,7 @@ import java.util.jar.Attributes; import java.util.jar.Manifest; import java.util.stream.Stream; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.util.Constants; import net.fabricmc.loom.util.FileSystemUtil; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java b/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java index ab2c5ee9..e71bea54 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/ModConfigurationRemapper.java @@ -58,7 +58,7 @@ import org.gradle.api.plugins.JavaPlugin; import org.gradle.api.tasks.SourceSet; import org.gradle.jvm.JvmLibrary; import org.gradle.language.base.artifact.SourcesArtifact; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -278,7 +278,7 @@ public class ModConfigurationRemapper { Map sourcesMap = downloadAllSources(project, resolvedArtifacts); for (ResolvedArtifact artifact : resolvedArtifacts) { - @Nullable Path sources = sourcesMap.get(artifact); + Path sources = sourcesMap.get(artifact); artifacts.add(new ArtifactRef.ResolvedArtifactRef(artifact, sources)); } diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/LocalMavenHelper.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/LocalMavenHelper.java index cf08e968..71ff6f09 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/LocalMavenHelper.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/LocalMavenHelper.java @@ -32,7 +32,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public record LocalMavenHelper(String group, String name, String version, @Nullable String baseClassifier, Path root, @Nullable String snapshotVersion) { public LocalMavenHelper(String group, String name, String version, @Nullable String baseClassifier, Path root) { diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependency.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependency.java index e8de5b39..fd9147fe 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependency.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependency.java @@ -30,7 +30,7 @@ import java.nio.file.Path; import org.gradle.api.Project; import org.gradle.api.artifacts.component.ComponentIdentifier; import org.gradle.api.internal.artifacts.repositories.resolver.MavenUniqueSnapshotComponentIdentifier; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.configuration.mods.ArtifactMetadata; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependencyFactory.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependencyFactory.java index 04a03619..8e8bf3e6 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependencyFactory.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/ModDependencyFactory.java @@ -30,7 +30,7 @@ import java.util.Optional; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.configuration.mods.ArtifactMetadata; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SimpleModDependency.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SimpleModDependency.java index 37078fcc..3529cf43 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SimpleModDependency.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SimpleModDependency.java @@ -30,7 +30,7 @@ import java.util.Objects; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.configuration.mods.ArtifactMetadata; import net.fabricmc.loom.configuration.mods.ArtifactRef; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SplitModDependency.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SplitModDependency.java index 0d01c5d1..0ef5922b 100644 --- a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SplitModDependency.java +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/SplitModDependency.java @@ -30,7 +30,7 @@ import java.util.Objects; import org.gradle.api.Project; import org.gradle.api.artifacts.Configuration; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.ModSettings; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/package-info.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/package-info.java new file mode 100644 index 00000000..5551ac69 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.mods.dependency; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/dependency/refmap/package-info.java b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/refmap/package-info.java new file mode 100644 index 00000000..c8703a9b --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/mods/dependency/refmap/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.mods.dependency.refmap; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/extension/package-info.java b/src/main/java/net/fabricmc/loom/configuration/mods/extension/package-info.java new file mode 100644 index 00000000..f74561a7 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/mods/extension/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.mods.extension; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/mods/package-info.java b/src/main/java/net/fabricmc/loom/configuration/mods/package-info.java new file mode 100644 index 00000000..37240c37 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/mods/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.mods; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/package-info.java b/src/main/java/net/fabricmc/loom/configuration/package-info.java new file mode 100644 index 00000000..7b6c36ce --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/LegacyJarProcessorWrapper.java b/src/main/java/net/fabricmc/loom/configuration/processors/LegacyJarProcessorWrapper.java index 847e391c..19caf292 100644 --- a/src/main/java/net/fabricmc/loom/configuration/processors/LegacyJarProcessorWrapper.java +++ b/src/main/java/net/fabricmc/loom/configuration/processors/LegacyJarProcessorWrapper.java @@ -30,7 +30,7 @@ import java.nio.file.Path; import javax.inject.Inject; import org.gradle.api.Project; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.processor.MinecraftJarProcessor; import net.fabricmc.loom.api.processor.ProcessorContext; @@ -56,7 +56,7 @@ public abstract class LegacyJarProcessorWrapper implements MinecraftJarProcessor } @Override - public @Nullable LegacyJarProcessorWrapper.Spec buildSpec(SpecContext context) { + public LegacyJarProcessorWrapper.@Nullable Spec buildSpec(SpecContext context) { delegate.setup(); return new Spec(delegate.getId()); } diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/MinecraftJarProcessorManager.java b/src/main/java/net/fabricmc/loom/configuration/processors/MinecraftJarProcessorManager.java index f513eec1..c41e8e30 100644 --- a/src/main/java/net/fabricmc/loom/configuration/processors/MinecraftJarProcessorManager.java +++ b/src/main/java/net/fabricmc/loom/configuration/processors/MinecraftJarProcessorManager.java @@ -36,7 +36,7 @@ import java.util.StringJoiner; import java.util.stream.Collectors; import org.gradle.api.Project; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -162,7 +162,7 @@ public final class MinecraftJarProcessorManager { return transformed; } - record ProcessorEntry(S spec, MinecraftJarProcessor processor, @Nullable MinecraftJarProcessor.MappingsProcessor mappingsProcessor) { + record ProcessorEntry(S spec, MinecraftJarProcessor processor, MinecraftJarProcessor.@Nullable MappingsProcessor mappingsProcessor) { @SuppressWarnings("unchecked") ProcessorEntry(MinecraftJarProcessor processor, MinecraftJarProcessor.Spec spec) { this((S) Objects.requireNonNull(spec), (MinecraftJarProcessor) processor, (MinecraftJarProcessor.MappingsProcessor) processor.processMappings()); diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java b/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java index 2e9abbc3..21261936 100644 --- a/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/processors/ModJavadocProcessor.java @@ -40,7 +40,7 @@ import java.util.Objects; import javax.inject.Inject; import com.google.gson.JsonElement; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,7 +76,7 @@ public abstract class ModJavadocProcessor implements MinecraftJarProcessor javadocs = new ArrayList<>(); for (FabricModJson fabricModJson : context.allMods()) { diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/package-info.java b/src/main/java/net/fabricmc/loom/configuration/processors/package-info.java new file mode 100644 index 00000000..d09f6774 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/processors/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.processors; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/RemappedSpecContext.java b/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/RemappedSpecContext.java index c90ac641..61db8d16 100644 --- a/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/RemappedSpecContext.java +++ b/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/RemappedSpecContext.java @@ -39,7 +39,7 @@ import java.util.stream.Stream; import org.gradle.api.Project; import org.gradle.api.plugins.JavaPlugin; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; import net.fabricmc.loom.api.RemapConfigurationSettings; diff --git a/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/package-info.java b/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/package-info.java new file mode 100644 index 00000000..43c484bf --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/processors/speccontext/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.processors.speccontext; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/BundleMetadata.java b/src/main/java/net/fabricmc/loom/configuration/providers/BundleMetadata.java index 4705fca4..8b766c80 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/BundleMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/BundleMetadata.java @@ -35,7 +35,7 @@ import java.util.List; import java.util.Optional; import org.gradle.api.Project; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.util.AttributeHelper; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediaryMappingsProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediaryMappingsProvider.java index 30da8be2..682d5142 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediaryMappingsProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediaryMappingsProvider.java @@ -41,8 +41,7 @@ import org.gradle.api.artifacts.ModuleDependency; import org.gradle.api.artifacts.dsl.DependencyFactory; import org.gradle.api.provider.Property; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -108,7 +107,7 @@ public abstract class IntermediaryMappingsProvider extends IntermediateMappingsP } @Override - public @NotNull String getName() { + public String getName() { final String encodedMcVersion = URLEncoder.encode(getMinecraftVersion().get(), StandardCharsets.UTF_8); final String urlRaw = getIntermediaryUrl().get(); diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediateMappingsProviderInternal.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediateMappingsProviderInternal.java index 8a52448a..eb0d6a92 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediateMappingsProviderInternal.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/IntermediateMappingsProviderInternal.java @@ -29,7 +29,7 @@ import java.nio.file.Path; import org.gradle.api.Project; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.mappings.intermediate.IntermediateMappingsProvider; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingsProcessor.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingsProcessor.java index 3aa6736f..a408448a 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingsProcessor.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/LayeredMappingsProcessor.java @@ -32,7 +32,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.mappings.layered.MappingContext; import net.fabricmc.loom.api.mappings.layered.MappingLayer; @@ -152,8 +152,7 @@ public class LayeredMappingsProcessor { return Collections.unmodifiableMap(signatureFixes); } - @Nullable - public UnpickLayer.UnpickData getUnpickData(List layers) throws IOException { + public UnpickLayer.@Nullable UnpickData getUnpickData(List layers) throws IOException { List unpickDataList = new ArrayList<>(); for (MappingLayer layer : layers) { diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java index 58e4dbb4..7a49bb34 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/MappingConfiguration.java @@ -42,7 +42,7 @@ import java.util.Objects; import org.apache.tools.ant.util.StringUtils; import org.gradle.api.Project; import org.gradle.api.provider.Provider; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/NoOpIntermediateMappingsProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/NoOpIntermediateMappingsProvider.java index 4c65eeb8..a09cfd75 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/NoOpIntermediateMappingsProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/NoOpIntermediateMappingsProvider.java @@ -29,8 +29,6 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import org.jetbrains.annotations.NotNull; - import net.fabricmc.loom.api.mappings.intermediate.IntermediateMappingsProvider; /** @@ -46,7 +44,7 @@ public abstract class NoOpIntermediateMappingsProvider extends IntermediateMappi } @Override - public @NotNull String getName() { + public String getName() { return "empty-intermediate"; } } diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/TinyMappingsService.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/TinyMappingsService.java index daa4eee8..8561f67d 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/TinyMappingsService.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/TinyMappingsService.java @@ -37,7 +37,7 @@ import org.gradle.api.provider.Provider; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Optional; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.util.FileSystemUtil; import net.fabricmc.loom.util.Lazy; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationNodeSerializer.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationNodeSerializer.java index 360f548a..2e89c37a 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationNodeSerializer.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationNodeSerializer.java @@ -36,7 +36,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.tree.AnnotationNode; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsData.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsData.java index 3143a754..12242083 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsData.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsData.java @@ -41,7 +41,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; import org.gradle.api.Project; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.tree.AnnotationNode; import org.objectweb.asm.tree.TypeAnnotationNode; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsLayer.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsLayer.java index 263d3ec9..cc5b42e2 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsLayer.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/AnnotationsLayer.java @@ -27,7 +27,7 @@ package net.fabricmc.loom.configuration.providers.mappings.extras.annotations; import java.io.IOException; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; @ApiStatus.Experimental public interface AnnotationsLayer { diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/ClassAnnotationData.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/ClassAnnotationData.java index b5ba93e1..9afda330 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/ClassAnnotationData.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/ClassAnnotationData.java @@ -33,7 +33,7 @@ import java.util.Set; import java.util.stream.Collectors; import com.google.gson.annotations.SerializedName; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.AnnotationNode; import org.objectweb.asm.tree.TypeAnnotationNode; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/TypeAnnotationKey.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/TypeAnnotationKey.java index 155952aa..a20553aa 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/TypeAnnotationKey.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/TypeAnnotationKey.java @@ -24,7 +24,7 @@ package net.fabricmc.loom.configuration.providers.mappings.extras.annotations; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.tinyremapper.TinyRemapper; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/package-info.java new file mode 100644 index 00000000..c896b99d --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.extras.annotations; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/AnnotationsDataValidator.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/AnnotationsDataValidator.java index 5450cc34..acb1df59 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/AnnotationsDataValidator.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/AnnotationsDataValidator.java @@ -35,7 +35,7 @@ import java.util.Objects; import java.util.Set; import java.util.function.Supplier; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/TypePathCheckerVisitor.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/TypePathCheckerVisitor.java index bc365058..b71c93a7 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/TypePathCheckerVisitor.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/TypePathCheckerVisitor.java @@ -27,7 +27,7 @@ package net.fabricmc.loom.configuration.providers.mappings.extras.annotations.va import java.util.ArrayDeque; import java.util.Deque; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.TypePath; import org.objectweb.asm.signature.SignatureVisitor; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/package-info.java new file mode 100644 index 00000000..fb93fafa --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/annotations/validate/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.extras.annotations.validate; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/signatures/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/signatures/package-info.java new file mode 100644 index 00000000..d40d34ad --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/signatures/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.extras.signatures; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/UnpickLayer.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/UnpickLayer.java index 1a827d15..bb1d0e5b 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/UnpickLayer.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/UnpickLayer.java @@ -29,7 +29,7 @@ import java.nio.file.Files; import java.nio.file.Path; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.configuration.providers.mappings.unpick.UnpickMetadata; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/package-info.java new file mode 100644 index 00000000..e4c180e9 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/extras/unpick/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.extras.unpick; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/FileMappingsLayer.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/FileMappingsLayer.java index 4b2dcd0f..cee7c305 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/FileMappingsLayer.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/FileMappingsLayer.java @@ -31,7 +31,7 @@ import java.nio.file.Path; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.mappings.layered.MappingLayer; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/package-info.java new file mode 100644 index 00000000..30ff463c --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/file/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.file; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/intermediary/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/intermediary/package-info.java new file mode 100644 index 00000000..211d3754 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/intermediary/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.intermediary; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingLayer.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingLayer.java index ffe586c8..efcdbff4 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingLayer.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/MojangMappingLayer.java @@ -34,7 +34,7 @@ import java.util.function.Supplier; import java.util.regex.Pattern; import org.gradle.api.logging.Logger; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.mappings.layered.MappingLayer; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/package-info.java new file mode 100644 index 00000000..c3d1d3d9 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/mojmap/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.mojmap; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/package-info.java new file mode 100644 index 00000000..2342a822 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/ParchmentTreeV1.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/ParchmentTreeV1.java index 081c9257..bbc6ddf3 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/ParchmentTreeV1.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/ParchmentTreeV1.java @@ -28,7 +28,7 @@ import java.io.IOException; import java.util.Collections; import java.util.List; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.mappingio.MappedElementKind; import net.fabricmc.mappingio.MappingVisitor; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/package-info.java new file mode 100644 index 00000000..b48cdd80 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/parchment/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.parchment; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/UnobfuscatedMappingNsCompleter.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/UnobfuscatedMappingNsCompleter.java index f51133fc..97fb4ea5 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/UnobfuscatedMappingNsCompleter.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/UnobfuscatedMappingNsCompleter.java @@ -29,7 +29,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.mappingio.MappedElementKind; import net.fabricmc.mappingio.MappingVisitor; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/package-info.java new file mode 100644 index 00000000..efef9d9b --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/tiny/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.tiny; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/UnpickMetadata.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/UnpickMetadata.java index 0f632fd7..c4722aca 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/UnpickMetadata.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/UnpickMetadata.java @@ -30,7 +30,7 @@ import java.nio.file.Files; import java.nio.file.Path; import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradlePlugin; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/package-info.java new file mode 100644 index 00000000..792d377c --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/unpick/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.unpick; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/mappings/utils/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/utils/package-info.java new file mode 100644 index 00000000..4410a972 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/mappings/utils/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.mappings.utils; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/AnnotationsApplyVisitor.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/AnnotationsApplyVisitor.java index 11a6895c..076423a6 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/AnnotationsApplyVisitor.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/AnnotationsApplyVisitor.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Objects; import java.util.function.BiConsumer; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftMetadataProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftMetadataProvider.java index dbdc0a48..afa8436c 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftMetadataProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftMetadataProvider.java @@ -33,7 +33,7 @@ import java.util.function.Function; import org.gradle.api.Project; import org.gradle.api.provider.Property; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.LoomGradlePlugin; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftProvider.java index 14fa8be9..69619b2a 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftProvider.java @@ -33,7 +33,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.gradle.api.JavaVersion; import org.gradle.api.Project; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftVersionMeta.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftVersionMeta.java index 2fbda51f..dcbd3bfc 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftVersionMeta.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/MinecraftVersionMeta.java @@ -29,7 +29,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.util.Constants; import net.fabricmc.loom.util.Platform; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/VersionsManifest.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/VersionsManifest.java index beefa2df..f2d2efbd 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/VersionsManifest.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/VersionsManifest.java @@ -27,7 +27,7 @@ package net.fabricmc.loom.configuration.providers.minecraft; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public record VersionsManifest(List versions, Map latest) { public static class Version { diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/assets/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/assets/package-info.java new file mode 100644 index 00000000..f323f95b --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/assets/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.minecraft.assets; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/Library.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/Library.java index 57778abb..d8f49b76 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/Library.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/Library.java @@ -24,7 +24,7 @@ package net.fabricmc.loom.configuration.providers.minecraft.library; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public record Library(String group, String name, String version, @Nullable String classifier, Target target) { public enum Target { diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/package-info.java new file mode 100644 index 00000000..05398eac --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.minecraft.library; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/processors/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/processors/package-info.java new file mode 100644 index 00000000..9342997a --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/library/processors/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.minecraft.library.processors; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/mapped/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/mapped/package-info.java new file mode 100644 index 00000000..167ec594 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/mapped/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.minecraft.mapped; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/package-info.java new file mode 100644 index 00000000..7c6b2b9a --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.minecraft; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/CertificateChain.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/CertificateChain.java index e0c16f45..2cf84c65 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/CertificateChain.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/CertificateChain.java @@ -35,7 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * A node in the certificate chain. @@ -142,7 +142,7 @@ public interface CertificateChain { class Impl implements CertificateChain { X509Certificate certificate; - @Nullable CertificateChain.Impl issuer; + CertificateChain.@Nullable Impl issuer; List children = new ArrayList<>(); private Impl() { diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/package-info.java new file mode 100644 index 00000000..24ccd67a --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/minecraft/verify/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers.minecraft.verify; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/package-info.java b/src/main/java/net/fabricmc/loom/configuration/providers/package-info.java new file mode 100644 index 00000000..eb391e67 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/providers/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.providers; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/configuration/sandbox/package-info.java b/src/main/java/net/fabricmc/loom/configuration/sandbox/package-info.java new file mode 100644 index 00000000..9f461bd0 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/configuration/sandbox/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.configuration.sandbox; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/decompilers/ClassLineNumbers.java b/src/main/java/net/fabricmc/loom/decompilers/ClassLineNumbers.java index 64928cad..2200664e 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/ClassLineNumbers.java +++ b/src/main/java/net/fabricmc/loom/decompilers/ClassLineNumbers.java @@ -34,7 +34,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public record ClassLineNumbers(Map lineMap) { public ClassLineNumbers { diff --git a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedData.java b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedData.java index 3674fe78..73446c43 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedData.java +++ b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedData.java @@ -39,7 +39,7 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.Objects; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +48,7 @@ import net.fabricmc.loom.decompilers.ClassLineNumbers; // Serialised data for a class entry in the cache // Uses the RIFF format, allows for appending the line numbers to the end of the file // Stores the source code and line numbers for the class -public record CachedData(String className, String sources, @Nullable ClassLineNumbers.Entry lineNumbers) { +public record CachedData(String className, String sources, ClassLineNumbers.@Nullable Entry lineNumbers) { public static final CachedFileStore.EntrySerializer SERIALIZER = new EntrySerializer(); private static final String HEADER_ID = "LOOM"; diff --git a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStore.java b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStore.java index ad73ec4c..6042dc64 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStore.java +++ b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStore.java @@ -27,7 +27,7 @@ package net.fabricmc.loom.decompilers.cache; import java.io.IOException; import java.nio.file.Path; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public interface CachedFileStore { @Nullable T getEntry(String key) throws IOException; diff --git a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStoreImpl.java b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStoreImpl.java index 545c6b7e..e71e5431 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStoreImpl.java +++ b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedFileStoreImpl.java @@ -38,7 +38,7 @@ import java.util.List; import java.util.Objects; import java.util.stream.Stream; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public record CachedFileStoreImpl(Path root, EntrySerializer entrySerializer, CacheRules cacheRules) implements CachedFileStore { public CachedFileStoreImpl { diff --git a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedJarProcessor.java b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedJarProcessor.java index 003726b6..0b9650fe 100644 --- a/src/main/java/net/fabricmc/loom/decompilers/cache/CachedJarProcessor.java +++ b/src/main/java/net/fabricmc/loom/decompilers/cache/CachedJarProcessor.java @@ -34,7 +34,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Stream; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/decompilers/cache/package-info.java b/src/main/java/net/fabricmc/loom/decompilers/cache/package-info.java new file mode 100644 index 00000000..93ab34d0 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/decompilers/cache/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.decompilers.cache; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/decompilers/package-info.java b/src/main/java/net/fabricmc/loom/decompilers/package-info.java new file mode 100644 index 00000000..6fe92dc5 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/decompilers/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.decompilers; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/extension/MixinExtension.java b/src/main/java/net/fabricmc/loom/extension/MixinExtension.java index fc9a2747..18374a69 100644 --- a/src/main/java/net/fabricmc/loom/extension/MixinExtension.java +++ b/src/main/java/net/fabricmc/loom/extension/MixinExtension.java @@ -40,8 +40,7 @@ import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskProvider; import org.gradle.api.tasks.util.PatternSet; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.api.MixinExtensionAPI; @@ -76,16 +75,12 @@ public interface MixinExtension extends MixinExtensionAPI { extra.set(MIXIN_INFORMATION_CONTAINER, container); } - @NotNull Stream getMixinSourceSetsStream(); - @NotNull Stream getApConfigurationsStream(Function getApConfigNameFunc); - @NotNull Stream>> getInvokerTasksStream(String compileTaskLanguage, Class taskType); - @NotNull @Input Collection getMixinSourceSets(); diff --git a/src/main/java/net/fabricmc/loom/extension/MixinExtensionImpl.java b/src/main/java/net/fabricmc/loom/extension/MixinExtensionImpl.java index 29e3b0df..cb2e7d07 100644 --- a/src/main/java/net/fabricmc/loom/extension/MixinExtensionImpl.java +++ b/src/main/java/net/fabricmc/loom/extension/MixinExtensionImpl.java @@ -47,7 +47,6 @@ import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskProvider; import org.gradle.api.tasks.util.PatternSet; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinExtension { private boolean isDefault; @@ -92,21 +91,18 @@ public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinEx } @Override - @NotNull public Stream getMixinSourceSetsStream() { return project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().stream() .filter(sourceSet -> MixinExtension.getMixinInformationContainer(sourceSet) != null); } @Override - @NotNull public Stream getApConfigurationsStream(Function getApConfigNameFunc) { return getMixinSourceSetsStream() .map(sourceSet -> project.getConfigurations().getByName(getApConfigNameFunc.apply(sourceSet))); } @Override - @NotNull public Stream>> getInvokerTasksStream(String compileTaskLanguage, Class taskType) { return getMixinSourceSetsStream() .flatMap(sourceSet -> { @@ -120,7 +116,6 @@ public class MixinExtensionImpl extends MixinExtensionApiImpl implements MixinEx } @Override - @NotNull @Input public Collection getMixinSourceSets() { return getMixinSourceSetsStream().collect(Collectors.toList()); diff --git a/src/main/java/net/fabricmc/loom/extension/RemapperExtensionHolder.java b/src/main/java/net/fabricmc/loom/extension/RemapperExtensionHolder.java index 45f778ff..6a5138e9 100644 --- a/src/main/java/net/fabricmc/loom/extension/RemapperExtensionHolder.java +++ b/src/main/java/net/fabricmc/loom/extension/RemapperExtensionHolder.java @@ -31,7 +31,7 @@ import javax.inject.Inject; import org.gradle.api.provider.Property; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Optional; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.commons.Remapper; diff --git a/src/main/java/net/fabricmc/loom/extension/package-info.java b/src/main/java/net/fabricmc/loom/extension/package-info.java new file mode 100644 index 00000000..93f4733c --- /dev/null +++ b/src/main/java/net/fabricmc/loom/extension/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.extension; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/package-info.java b/src/main/java/net/fabricmc/loom/package-info.java new file mode 100644 index 00000000..f886eda5 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/task/AbstractRunTask.java b/src/main/java/net/fabricmc/loom/task/AbstractRunTask.java index f54d11fe..c1483f5b 100644 --- a/src/main/java/net/fabricmc/loom/task/AbstractRunTask.java +++ b/src/main/java/net/fabricmc/loom/task/AbstractRunTask.java @@ -51,7 +51,6 @@ import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.JavaExec; import org.gradle.process.ExecOperations; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -242,13 +241,13 @@ public abstract class AbstractRunTask extends JavaExec { } // https://github.com/JetBrains/intellij-community/blob/295dd68385a458bdfde638152e36d19bed18b666/platform/util/base/src/com/intellij/openapi/util/text/Strings.java#L100-L118 - public static boolean containsAnyChar(final @NotNull String value, final @NotNull String chars) { + public static boolean containsAnyChar(final String value, final String chars) { return chars.length() > value.length() ? containsAnyChar(value, chars, 0, value.length()) : containsAnyChar(chars, value, 0, chars.length()); } - public static boolean containsAnyChar(final @NotNull String value, final @NotNull String chars, final int start, final int end) { + public static boolean containsAnyChar(final String value, final String chars, final int start, final int end) { for (int i = start; i < end; i++) { if (chars.indexOf(value.charAt(i)) >= 0) { return true; @@ -259,19 +258,19 @@ public abstract class AbstractRunTask extends JavaExec { } @Override - public @NotNull JavaExec setClasspath(@NotNull FileCollection classpath) { + public JavaExec setClasspath(FileCollection classpath) { this.getInternalClasspath().setFrom(classpath); return this; } @Override - public @NotNull JavaExec classpath(Object @NotNull... paths) { + public JavaExec classpath(Object... paths) { this.getInternalClasspath().from(paths); return this; } @Override - public @NotNull FileCollection getClasspath() { + public FileCollection getClasspath() { return this.getInternalClasspath(); } diff --git a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java index 1d7ada8f..c0ea15b7 100644 --- a/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java +++ b/src/main/java/net/fabricmc/loom/task/GenerateSourcesTask.java @@ -68,7 +68,7 @@ import org.gradle.workers.WorkQueue; import org.gradle.workers.WorkerExecutor; import org.gradle.workers.internal.WorkerDaemonClientsManager; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.decompilers.DecompilationMetadata; @@ -316,7 +316,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask { if (job instanceof CachedJarProcessor.WorkToDoJob workToDoJob) { Path workInputJar = workToDoJob.incomplete(); - @Nullable Path existingClasses = (job instanceof CachedJarProcessor.PartialWorkJob partialWorkJob) ? partialWorkJob.existingClasses() : null; + Path existingClasses = (job instanceof CachedJarProcessor.PartialWorkJob partialWorkJob) ? partialWorkJob.existingClasses() : null; if (usingUnpick()) { try (var timer = new Timer("Unpick")) { diff --git a/src/main/java/net/fabricmc/loom/task/LoomTasks.java b/src/main/java/net/fabricmc/loom/task/LoomTasks.java index c39023f2..74f332b0 100644 --- a/src/main/java/net/fabricmc/loom/task/LoomTasks.java +++ b/src/main/java/net/fabricmc/loom/task/LoomTasks.java @@ -37,7 +37,6 @@ import org.gradle.api.tasks.Sync; import org.gradle.api.tasks.TaskContainer; import org.gradle.api.tasks.TaskOutputs; import org.gradle.api.tasks.TaskProvider; -import org.jetbrains.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.configuration.ide.RunConfigSettings; @@ -72,7 +71,7 @@ public abstract class LoomTasks implements Runnable { t.setDescription("Generate the log4j config file"); }); - @Nullable TaskProvider generateRemapClasspath = null; + TaskProvider generateRemapClasspath = null; if (!extension.disableObfuscation()) { generateRemapClasspath = getTasks().register("generateRemapClasspath", GenerateRemapClasspathTask.class, t -> { @@ -81,7 +80,7 @@ public abstract class LoomTasks implements Runnable { } // Make the lambda happy - final @Nullable TaskProvider generateRemapClasspathTask = generateRemapClasspath; + final TaskProvider generateRemapClasspathTask = generateRemapClasspath; getTasks().register("generateDLIConfig", GenerateDLIConfigTask.class, t -> { t.setDescription("Generate the DevLaunchInjector config file"); diff --git a/src/main/java/net/fabricmc/loom/task/ManifestModificationAction.java b/src/main/java/net/fabricmc/loom/task/ManifestModificationAction.java index 841773bf..0f7414dd 100644 --- a/src/main/java/net/fabricmc/loom/task/ManifestModificationAction.java +++ b/src/main/java/net/fabricmc/loom/task/ManifestModificationAction.java @@ -39,7 +39,6 @@ import org.gradle.api.Action; import org.gradle.api.Task; import org.gradle.api.provider.Provider; import org.gradle.jvm.tasks.Jar; -import org.jetbrains.annotations.NotNull; import net.fabricmc.loom.task.service.JarManifestService; import net.fabricmc.loom.util.Check; @@ -68,7 +67,7 @@ public class ManifestModificationAction implements Action, Serializable { } @Override - public void execute(@NotNull Task t) { + public void execute(Task t) { final Jar jarTask = (Jar) t; final File jarFile = jarTask.getArchiveFile().get().getAsFile(); diff --git a/src/main/java/net/fabricmc/loom/task/NestJarsAction.java b/src/main/java/net/fabricmc/loom/task/NestJarsAction.java index 4715408a..0a93c7f3 100644 --- a/src/main/java/net/fabricmc/loom/task/NestJarsAction.java +++ b/src/main/java/net/fabricmc/loom/task/NestJarsAction.java @@ -41,7 +41,6 @@ import org.gradle.workers.WorkAction; import org.gradle.workers.WorkParameters; import org.gradle.workers.WorkQueue; import org.gradle.workers.WorkerExecutor; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,7 +66,7 @@ public abstract class NestJarsAction implements Action, Serializable { } @Override - public void execute(@NotNull Task t) { + public void execute(Task t) { final Jar jarTask = (Jar) t; final WorkQueue workQueue = getWorkerExecutor().noIsolation(); diff --git a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java index 7686e882..0fe1784f 100644 --- a/src/main/java/net/fabricmc/loom/task/RemapJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/RemapJarTask.java @@ -47,7 +47,7 @@ import org.gradle.api.tasks.Nested; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.TaskProvider; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/task/ValidateMixinNameTask.java b/src/main/java/net/fabricmc/loom/task/ValidateMixinNameTask.java index 8093e04b..4faa73ab 100644 --- a/src/main/java/net/fabricmc/loom/task/ValidateMixinNameTask.java +++ b/src/main/java/net/fabricmc/loom/task/ValidateMixinNameTask.java @@ -47,7 +47,7 @@ import org.gradle.workers.WorkAction; import org.gradle.workers.WorkParameters; import org.gradle.workers.WorkQueue; import org.gradle.workers.WorkerExecutor; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.ClassReader; diff --git a/src/main/java/net/fabricmc/loom/task/launch/package-info.java b/src/main/java/net/fabricmc/loom/task/launch/package-info.java new file mode 100644 index 00000000..f2ba0930 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/task/launch/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.task.launch; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/task/package-info.java b/src/main/java/net/fabricmc/loom/task/package-info.java new file mode 100644 index 00000000..79229a64 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/task/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.task; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/task/prod/package-info.java b/src/main/java/net/fabricmc/loom/task/prod/package-info.java new file mode 100644 index 00000000..773b28a1 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/task/prod/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.task.prod; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/task/service/MixinAPMappingService.java b/src/main/java/net/fabricmc/loom/task/service/MixinAPMappingService.java index 55ea8a34..7f80d5b8 100644 --- a/src/main/java/net/fabricmc/loom/task/service/MixinAPMappingService.java +++ b/src/main/java/net/fabricmc/loom/task/service/MixinAPMappingService.java @@ -42,7 +42,7 @@ import org.gradle.api.provider.Provider; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.SourceSet; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/task/service/SourceMappingsService.java b/src/main/java/net/fabricmc/loom/task/service/SourceMappingsService.java index bb19944d..dad8f8fd 100644 --- a/src/main/java/net/fabricmc/loom/task/service/SourceMappingsService.java +++ b/src/main/java/net/fabricmc/loom/task/service/SourceMappingsService.java @@ -39,7 +39,7 @@ import org.gradle.api.provider.Provider; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Optional; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java b/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java index 2ab2ae17..6901ec98 100644 --- a/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java +++ b/src/main/java/net/fabricmc/loom/task/service/TinyRemapperService.java @@ -49,7 +49,7 @@ import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Nested; import org.gradle.api.tasks.Optional; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.api.mappings.layered.MappingsNamespace; diff --git a/src/main/java/net/fabricmc/loom/task/service/UnpickService.java b/src/main/java/net/fabricmc/loom/task/service/UnpickService.java index 8168a25a..70a9dec0 100644 --- a/src/main/java/net/fabricmc/loom/task/service/UnpickService.java +++ b/src/main/java/net/fabricmc/loom/task/service/UnpickService.java @@ -54,7 +54,7 @@ import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Nested; import org.gradle.api.tasks.Optional; import org.gradle.api.tasks.OutputFile; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.tree.ClassNode; diff --git a/src/main/java/net/fabricmc/loom/task/service/package-info.java b/src/main/java/net/fabricmc/loom/task/service/package-info.java new file mode 100644 index 00000000..06b76ae1 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/task/service/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.task.service; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/task/tool/package-info.java b/src/main/java/net/fabricmc/loom/task/tool/package-info.java new file mode 100644 index 00000000..6cbab462 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/task/tool/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.task.tool; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/Checksum.java b/src/main/java/net/fabricmc/loom/util/Checksum.java index 27a5258d..e7e316cb 100644 --- a/src/main/java/net/fabricmc/loom/util/Checksum.java +++ b/src/main/java/net/fabricmc/loom/util/Checksum.java @@ -39,7 +39,6 @@ import java.util.List; import org.gradle.api.Project; import org.gradle.api.file.FileCollection; -import org.jetbrains.annotations.NotNull; public final class Checksum { public static Checksum of(byte[] data) { @@ -152,7 +151,7 @@ public final class Checksum { } @Override - public void write(byte @NotNull[] b, int off, int len) { + public void write(byte[] b, int off, int len) { digest.update(b, off, len); } diff --git a/src/main/java/net/fabricmc/loom/util/Lazy.java b/src/main/java/net/fabricmc/loom/util/Lazy.java index 5c2c0109..8674435e 100644 --- a/src/main/java/net/fabricmc/loom/util/Lazy.java +++ b/src/main/java/net/fabricmc/loom/util/Lazy.java @@ -26,7 +26,7 @@ package net.fabricmc.loom.util; import java.util.function.Supplier; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; // Can be replaced by Lazy Constants (https://openjdk.org/jeps/526) once available. public final class Lazy { diff --git a/src/main/java/net/fabricmc/loom/util/ZipUtils.java b/src/main/java/net/fabricmc/loom/util/ZipUtils.java index 9d73a4c2..29884c8b 100644 --- a/src/main/java/net/fabricmc/loom/util/ZipUtils.java +++ b/src/main/java/net/fabricmc/loom/util/ZipUtils.java @@ -43,7 +43,7 @@ import java.util.Map; import java.util.function.Function; import java.util.stream.Stream; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; diff --git a/src/main/java/net/fabricmc/loom/util/download/GradleDownloadProgressListener.java b/src/main/java/net/fabricmc/loom/util/download/GradleDownloadProgressListener.java index 3321ddf0..a7cd05f0 100644 --- a/src/main/java/net/fabricmc/loom/util/download/GradleDownloadProgressListener.java +++ b/src/main/java/net/fabricmc/loom/util/download/GradleDownloadProgressListener.java @@ -28,7 +28,7 @@ import java.util.Objects; import java.util.function.Function; import org.gradle.internal.logging.progress.ProgressLogger; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public class GradleDownloadProgressListener implements DownloadProgressListener { private final String name; diff --git a/src/main/java/net/fabricmc/loom/util/download/package-info.java b/src/main/java/net/fabricmc/loom/util/download/package-info.java new file mode 100644 index 00000000..9b7d1f70 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/download/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.download; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java index 3fcd2a39..ecfb3d9e 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJson.java @@ -32,7 +32,7 @@ import java.util.Objects; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; public abstract sealed class FabricModJson permits FabricModJsonV0, FabricModJsonV1, FabricModJsonV2, FabricModJson.Mockable { diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java index bb0d2a31..4bd9b255 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java @@ -39,7 +39,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; import org.gradle.api.Project; import org.gradle.api.tasks.SourceSet; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java index 935b0cea..1c07a3d2 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV0.java @@ -33,7 +33,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; @Deprecated public final class FabricModJsonV0 extends FabricModJson { diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java index 16239e0b..800cdf3d 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV1.java @@ -36,7 +36,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; public final class FabricModJsonV1 extends FabricModJson { FabricModJsonV1(JsonObject jsonObject, FabricModJsonSource source) { diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java index ed52bef4..044d6edd 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonV2.java @@ -34,7 +34,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.util.Pair; diff --git a/src/main/java/net/fabricmc/loom/util/fmj/gen/package-info.java b/src/main/java/net/fabricmc/loom/util/fmj/gen/package-info.java new file mode 100644 index 00000000..e0c34c46 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/fmj/gen/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.fmj.gen; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/fmj/mixin/MixinConfiguration.java b/src/main/java/net/fabricmc/loom/util/fmj/mixin/MixinConfiguration.java index 5e74518b..cc367ac0 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/mixin/MixinConfiguration.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/mixin/MixinConfiguration.java @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.List; import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import net.fabricmc.loom.LoomGradlePlugin; import net.fabricmc.loom.util.fmj.FabricModJson; diff --git a/src/main/java/net/fabricmc/loom/util/fmj/mixin/package-info.java b/src/main/java/net/fabricmc/loom/util/fmj/mixin/package-info.java new file mode 100644 index 00000000..6ad82776 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/fmj/mixin/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.fmj.mixin; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/fmj/package-info.java b/src/main/java/net/fabricmc/loom/util/fmj/package-info.java new file mode 100644 index 00000000..5959c2db --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/fmj/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.fmj; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/gradle/SourceSetHelper.java b/src/main/java/net/fabricmc/loom/util/gradle/SourceSetHelper.java index 8560a4e9..a997a763 100644 --- a/src/main/java/net/fabricmc/loom/util/gradle/SourceSetHelper.java +++ b/src/main/java/net/fabricmc/loom/util/gradle/SourceSetHelper.java @@ -48,7 +48,7 @@ import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.SourceSetOutput; import org.intellij.lang.annotations.Language; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; import org.xml.sax.InputSource; diff --git a/src/main/java/net/fabricmc/loom/util/gradle/daemon/DaemonUtils.java b/src/main/java/net/fabricmc/loom/util/gradle/daemon/DaemonUtils.java index 2ec97583..ecb8b7f4 100644 --- a/src/main/java/net/fabricmc/loom/util/gradle/daemon/DaemonUtils.java +++ b/src/main/java/net/fabricmc/loom/util/gradle/daemon/DaemonUtils.java @@ -47,7 +47,7 @@ import org.gradle.launcher.daemon.registry.DaemonInfo; import org.gradle.launcher.daemon.registry.DaemonRegistry; import org.gradle.launcher.daemon.registry.PersistentDaemonRegistry; import org.gradle.util.GradleVersion; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; import org.jetbrains.annotations.VisibleForTesting; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/net/fabricmc/loom/util/gradle/daemon/package-info.java b/src/main/java/net/fabricmc/loom/util/gradle/daemon/package-info.java new file mode 100644 index 00000000..57cbe44c --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/gradle/daemon/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.gradle.daemon; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/gradle/package-info.java b/src/main/java/net/fabricmc/loom/util/gradle/package-info.java new file mode 100644 index 00000000..ade0a033 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/gradle/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.gradle; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/ipc/package-info.java b/src/main/java/net/fabricmc/loom/util/ipc/package-info.java new file mode 100644 index 00000000..a6c599d2 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/ipc/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.ipc; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/kotlin/package-info.java b/src/main/java/net/fabricmc/loom/util/kotlin/package-info.java new file mode 100644 index 00000000..cf144f35 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/kotlin/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.kotlin; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/package-info.java b/src/main/java/net/fabricmc/loom/util/package-info.java new file mode 100644 index 00000000..0374e2a4 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util; + +import org.jspecify.annotations.NullMarked; diff --git a/src/main/java/net/fabricmc/loom/util/service/ServiceFactory.java b/src/main/java/net/fabricmc/loom/util/service/ServiceFactory.java index 267405f5..e50072ab 100644 --- a/src/main/java/net/fabricmc/loom/util/service/ServiceFactory.java +++ b/src/main/java/net/fabricmc/loom/util/service/ServiceFactory.java @@ -25,7 +25,7 @@ package net.fabricmc.loom.util.service; import org.gradle.api.provider.Provider; -import org.jetbrains.annotations.Nullable; +import org.jspecify.annotations.Nullable; /** * A factory for creating {@link Service} instances. diff --git a/src/main/java/net/fabricmc/loom/util/service/package-info.java b/src/main/java/net/fabricmc/loom/util/service/package-info.java new file mode 100644 index 00000000..a654ea22 --- /dev/null +++ b/src/main/java/net/fabricmc/loom/util/service/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) 2025 FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.util.service; + +import org.jspecify.annotations.NullMarked; diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/processor/AnnotationsApplyTest.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/processor/AnnotationsApplyTest.groovy index ee63af1b..3165f210 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/processor/AnnotationsApplyTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/processor/AnnotationsApplyTest.groovy @@ -28,7 +28,7 @@ import groovy.transform.CompileStatic import org.intellij.lang.annotations.Language import org.jetbrains.annotations.ApiStatus import org.jetbrains.annotations.NotNull -import org.jetbrains.annotations.Nullable +import org.jspecify.annotations.Nullable import org.objectweb.asm.ClassReader import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.FieldNode @@ -159,7 +159,7 @@ class AnnotationsApplyTest extends Specification { }, "field2:Ljava/lang/String;": { "remove": [ - "org/jetbrains/annotations/Nullable" + "org/jspecify/annotations/Nullable" ], "add": [ { @@ -184,7 +184,7 @@ class AnnotationsApplyTest extends Specification { "parameters": { "0": { "remove": [ - "org/jetbrains/annotations/NotNull" + "org/jspecify/annotations/NotNull" ], "add": [ { @@ -263,7 +263,7 @@ public class net/fabricmc/loom/test/unit/processor/AnnotationsApplyTest$ExampleC private Ljava/lang/String; field2 @Ljava/lang/Deprecated;() // invisible @Lorg/jetbrains/annotations/ApiStatus$Internal;() // invisible - @Lorg/jetbrains/annotations/Nullable;() : FIELD, null // invisible + @Lorg/jspecify/annotations/Nullable;() : FIELD, null ''' private static final String EXPECTED_METHOD1 = ''' @@ -272,6 +272,7 @@ public class net/fabricmc/loom/test/unit/processor/AnnotationsApplyTest$ExampleC @Lorg/jetbrains/annotations/ApiStatus$OverrideOnly;() // invisible @Lorg/jetbrains/annotations/NotNull;() : METHOD_FORMAL_PARAMETER 0, null // invisible // annotable parameter count: 1 (invisible) + @Lorg/jetbrains/annotations/NotNull;() // invisible, parameter 0 @Lorg/jetbrains/annotations/UnknownNullability;() // invisible, parameter 0 ''' diff --git a/src/test/groovy/net/fabricmc/loom/test/unit/processor/TypePathCheckerVisitorTest.groovy b/src/test/groovy/net/fabricmc/loom/test/unit/processor/TypePathCheckerVisitorTest.groovy index 1419d803..b89e1f50 100644 --- a/src/test/groovy/net/fabricmc/loom/test/unit/processor/TypePathCheckerVisitorTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/unit/processor/TypePathCheckerVisitorTest.groovy @@ -24,7 +24,7 @@ package net.fabricmc.loom.test.unit.processor -import org.jetbrains.annotations.Nullable +import org.jspecify.annotations.Nullable import org.objectweb.asm.TypePath import org.objectweb.asm.signature.SignatureReader import spock.lang.Specification diff --git a/src/test/groovy/net/fabricmc/loom/test/util/GradleTestUtil.groovy b/src/test/groovy/net/fabricmc/loom/test/util/GradleTestUtil.groovy index c1faaad2..3caadd0a 100644 --- a/src/test/groovy/net/fabricmc/loom/test/util/GradleTestUtil.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/util/GradleTestUtil.groovy @@ -37,7 +37,7 @@ import org.gradle.api.provider.Property import org.gradle.api.provider.ProviderFactory import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.util.PatternFilterable -import org.jetbrains.annotations.Nullable +import org.jspecify.annotations.Nullable import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer diff --git a/src/test/java/net/fabricmc/loom/test/unit/package-info.java b/src/test/java/net/fabricmc/loom/test/unit/package-info.java new file mode 100644 index 00000000..72aa4ea9 --- /dev/null +++ b/src/test/java/net/fabricmc/loom/test/unit/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) $YEAR FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.test.unit; + +import org.jspecify.annotations.NullMarked; diff --git a/src/test/java/net/fabricmc/loom/test/unit/processor/classes/package-info.java b/src/test/java/net/fabricmc/loom/test/unit/processor/classes/package-info.java new file mode 100644 index 00000000..54704a24 --- /dev/null +++ b/src/test/java/net/fabricmc/loom/test/unit/processor/classes/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) $YEAR FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.test.unit.processor.classes; + +import org.jspecify.annotations.NullMarked; diff --git a/src/test/java/net/fabricmc/loom/test/unit/sandbox/package-info.java b/src/test/java/net/fabricmc/loom/test/unit/sandbox/package-info.java new file mode 100644 index 00000000..997d61b7 --- /dev/null +++ b/src/test/java/net/fabricmc/loom/test/unit/sandbox/package-info.java @@ -0,0 +1,28 @@ +/* + * This file is part of fabric-loom, licensed under the MIT License (MIT). + * + * Copyright (c) $YEAR FabricMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +@NullMarked +package net.fabricmc.loom.test.unit.sandbox; + +import org.jspecify.annotations.NullMarked;