diff --git a/README.md b/README.md index 71a1bb9bf..3f387cc72 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ are always welcome! - Implements in-memory file management compatible with the NIO Path and FileSystem API, enabling tests to run without write access to the host system, and without awkward resource-cleanup logic. -- Ability to run compilation on combinations of real files, class path - resources, and in-memory files. +- Enables running compilations on combinations of real files, class path + resources, in-memory files, JARs, WARs, EARs, ZIP files, etc. - Supports Java 9 JPMS modules as intended. - Ability to customise a large assortment of configuration parameters to enable you to test exactly what you need to test. @@ -52,14 +52,15 @@ are always welcome! - Implements a fully functional JSR-199 Path JavaFileManager. - Fluent syntax for creating configurations, executing them, and inspecting the results. -- Integration with AssertJ for fluent assertions on compilation - results. +- Integration with [AssertJ](https://joel-costigliola.github.io/assertj/) + for fluent assertions on compilation results. - Ability to have multiple source roots, just like when using `javac` normally. -- Diagnostic reporting includes stacktraces, so you can find out +- Diagnostic reporting includes stack traces, so you can find out exactly what triggered a diagnostic and begin debugging any issues in your applications quickly. - Helpful error messages to assist in annotation processor development +- Null-safe API (using [JSpecify](https://jspecify.dev/)) ``` [main] ERROR io.github.ascopes.jct.diagnostics.TracingDiagnosticListener - cannot find symbol diff --git a/java-compiler-testing/pom.xml b/java-compiler-testing/pom.xml index 276b57ec6..53fc157f1 100644 --- a/java-compiler-testing/pom.xml +++ b/java-compiler-testing/pom.xml @@ -37,13 +37,6 @@ - - com.google.code.findbugs - jsr305 - provided - true - - com.google.jimfs jimfs @@ -66,6 +59,12 @@ assertj-core + + org.jspecify + jspecify + true + + org.junit.jupiter diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractContainerGroupAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractContainerGroupAssert.java index d7fab76b6..fd4597bb5 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractContainerGroupAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractContainerGroupAssert.java @@ -21,15 +21,13 @@ import io.github.ascopes.jct.containers.ContainerGroup; import java.util.ArrayList; import java.util.List; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractListAssert; import org.assertj.core.api.Assertions; import org.assertj.core.api.ObjectAssert; +import org.jspecify.annotations.Nullable; /** * Base assertions that can be performed on a container group. @@ -40,7 +38,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public abstract class AbstractContainerGroupAssert, C extends ContainerGroup> extends AbstractAssert { @@ -68,7 +65,6 @@ protected AbstractContainerGroupAssert(@Nullable C containerGroup, Class self * @return the assertions to perform. * @throws AssertionError if the object being asserted upon is null. */ - @CheckReturnValue public LocationAssert location() { isNotNull(); return new LocationAssert(actual.getLocation()); @@ -83,7 +79,6 @@ public LocationAssert location() { * @throws AssertionError if the object being asserted upon is null. * @throws NullPointerException if the provided class parameter is null. */ - @CheckReturnValue public AbstractListAssert, T, ? extends ObjectAssert> services( Class clazz ) { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractEnumAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractEnumAssert.java index c63c38dc5..3b31a255e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractEnumAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractEnumAssert.java @@ -22,11 +22,10 @@ import io.github.ascopes.jct.utils.IterableUtils; import java.util.List; import java.util.function.Supplier; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractAssert; +import org.jspecify.annotations.Nullable; /** * Abstract base class for an assertion on an {@link Enum}. @@ -37,7 +36,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public abstract class AbstractEnumAssert, E extends Enum> extends AbstractAssert { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractJavaFileObjectAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractJavaFileObjectAssert.java index 14e2daede..2a2dd921a 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractJavaFileObjectAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/AbstractJavaFileObjectAssert.java @@ -26,9 +26,6 @@ import java.nio.charset.CharsetDecoder; import java.nio.charset.StandardCharsets; import java.time.Instant; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -37,6 +34,7 @@ import org.assertj.core.api.AbstractInstantAssert; import org.assertj.core.api.AbstractStringAssert; import org.assertj.core.api.AbstractUriAssert; +import org.jspecify.annotations.Nullable; /** * Abstract assertions for {@link JavaFileObject Java file objects}. @@ -47,7 +45,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public abstract class AbstractJavaFileObjectAssert, A extends JavaFileObject> extends AbstractAssert { @@ -67,7 +64,6 @@ protected AbstractJavaFileObjectAssert(@Nullable A actual, Class selfType) { * @return the URI assertion. * @throws AssertionError if the actual value is null. */ - @CheckReturnValue public AbstractUriAssert uri() { isNotNull(); return assertThat(actual.toUri()); @@ -79,7 +75,6 @@ public AbstractUriAssert uri() { * @return the string assertion. * @throws AssertionError if the actual value is null. */ - @CheckReturnValue public AbstractStringAssert name() { isNotNull(); return assertThat(actual.getName()); @@ -91,7 +86,6 @@ public AbstractStringAssert name() { * @return the byte array assertion. * @throws AssertionError if the actual value is null. */ - @CheckReturnValue public AbstractByteArrayAssert binaryContent() { isNotNull(); return assertThat(rawContent()); @@ -105,7 +99,6 @@ public AbstractByteArrayAssert binaryContent() { * @throws AssertionError if the actual value is null. * @throws UncheckedIOException if an IO error occurs reading the file content. */ - @CheckReturnValue public AbstractStringAssert content() { return content(StandardCharsets.UTF_8); } @@ -119,7 +112,6 @@ public AbstractStringAssert content() { * @throws NullPointerException if the charset parameter is null. * @throws UncheckedIOException if an IO error occurs reading the file content. */ - @CheckReturnValue public AbstractStringAssert content(Charset charset) { requireNonNull(charset, "charset must not be null"); return content(charset.newDecoder()); @@ -134,7 +126,6 @@ public AbstractStringAssert content(Charset charset) { * @throws NullPointerException if the charset decoder parameter is null. * @throws UncheckedIOException if an IO error occurs reading the file content. */ - @CheckReturnValue public AbstractStringAssert content(CharsetDecoder charsetDecoder) { requireNonNull(charsetDecoder, "charsetDecoder must not be null"); isNotNull(); @@ -155,7 +146,6 @@ public AbstractStringAssert content(CharsetDecoder charsetDecoder) { * @return the instant assertion. * @throws AssertionError if the actual value is null. */ - @CheckReturnValue public AbstractInstantAssert lastModified() { isNotNull(); @@ -169,7 +159,6 @@ public AbstractInstantAssert lastModified() { * @return the assertions for the kind. * @throws AssertionError if the actual value is null. */ - @CheckReturnValue public JavaFileObjectKindAssert kind() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ClassLoaderAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ClassLoaderAssert.java index 2eb0bd3f3..3c1caf20d 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ClassLoaderAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ClassLoaderAssert.java @@ -15,11 +15,10 @@ */ package io.github.ascopes.jct.assertions; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractAssert; +import org.jspecify.annotations.Nullable; /** * Assertions to perform on a classloader. @@ -31,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class ClassLoaderAssert extends AbstractAssert { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/DiagnosticKindAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/DiagnosticKindAssert.java index 4c170a47b..b6815422c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/DiagnosticKindAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/DiagnosticKindAssert.java @@ -16,11 +16,10 @@ package io.github.ascopes.jct.assertions; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.Diagnostic.Kind; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Assertions for an individual diagnostic kind. @@ -29,7 +28,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class DiagnosticKindAssert extends AbstractEnumAssert { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectAssert.java index 9cdd15575..6807cec9b 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectAssert.java @@ -15,11 +15,10 @@ */ package io.github.ascopes.jct.assertions; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Assertions for {@link JavaFileObject Java file objects}. @@ -28,7 +27,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JavaFileObjectAssert extends AbstractJavaFileObjectAssert { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectKindAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectKindAssert.java index aa5e7d2ab..b2aeb060f 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectKindAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JavaFileObjectKindAssert.java @@ -17,13 +17,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileObject.Kind; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractStringAssert; +import org.jspecify.annotations.Nullable; /** * Assertions for an individual {@link Kind Java file object kind}. @@ -32,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JavaFileObjectKindAssert extends AbstractEnumAssert { @@ -91,7 +88,6 @@ public JavaFileObjectKindAssert isOther() { * @return the assertions for the file extension of the kind. * @throws AssertionError if the kind is null. */ - @CheckReturnValue public AbstractStringAssert extension() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctAssertions.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctAssertions.java index 1cdcb3cc9..54dc02174 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctAssertions.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctAssertions.java @@ -23,14 +23,12 @@ import io.github.ascopes.jct.filemanagers.PathFileObject; import io.github.ascopes.jct.utils.UtilityClass; import java.util.List; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.Diagnostic; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Helper class to provide fluent creation of assertions for compilations. @@ -39,7 +37,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctAssertions extends UtilityClass { private JctAssertions() { @@ -56,7 +53,6 @@ private JctAssertions() { * @param compilation the compilation to assert on. * @return the assertion. */ - @CheckReturnValue public static JctCompilationAssert assertThat(@Nullable JctCompilation compilation) { return assertThatCompilation(compilation); } @@ -71,9 +67,8 @@ public static JctCompilationAssert assertThat(@Nullable JctCompilation compilati * @param moduleContainerGroup the module container group to assert on. * @return the assertion. */ - @CheckReturnValue public static ModuleContainerGroupAssert assertThat( - @Nullable ModuleContainerGroup moduleContainerGroup + ModuleContainerGroup moduleContainerGroup ) { return assertThatContainerGroup(moduleContainerGroup); } @@ -88,9 +83,8 @@ public static ModuleContainerGroupAssert assertThat( * @param outputContainerGroup the output container group to assert on. * @return the assertion. */ - @CheckReturnValue public static OutputContainerGroupAssert assertThat( - @Nullable OutputContainerGroup outputContainerGroup + OutputContainerGroup outputContainerGroup ) { return assertThatContainerGroup(outputContainerGroup); } @@ -105,9 +99,8 @@ public static OutputContainerGroupAssert assertThat( * @param packageContainerGroup the package container group to assert on. * @return the assertion. */ - @CheckReturnValue public static PackageContainerGroupAssert assertThat( - @Nullable PackageContainerGroup packageContainerGroup + PackageContainerGroup packageContainerGroup ) { return assertThatContainerGroup(packageContainerGroup); } @@ -122,9 +115,8 @@ public static PackageContainerGroupAssert assertThat( * @param diagnostic the diagnostic to assert on. * @return the assertion. */ - @CheckReturnValue public static TraceDiagnosticAssert assertThat( - @Nullable TraceDiagnostic diagnostic + TraceDiagnostic diagnostic ) { return assertThatDiagnostic(diagnostic); } @@ -139,7 +131,6 @@ public static TraceDiagnosticAssert assertThat( * @param fileObject the file object to assert on. * @return the assertion. */ - @CheckReturnValue public static JavaFileObjectAssert assertThat(@Nullable JavaFileObject fileObject) { return assertThatFileObject(fileObject); } @@ -154,7 +145,6 @@ public static JavaFileObjectAssert assertThat(@Nullable JavaFileObject fileObjec * @param fileObject the file object to assert on. * @return the assertion. */ - @CheckReturnValue public static PathFileObjectAssert assertThat(@Nullable PathFileObject fileObject) { return assertThatFileObject(fileObject); } @@ -169,8 +159,7 @@ public static PathFileObjectAssert assertThat(@Nullable PathFileObject fileObjec * @param kind the diagnostic kind to assert on. * @return the assertion. */ - @CheckReturnValue - public static DiagnosticKindAssert assertThat(@Nullable Diagnostic.Kind kind) { + public static DiagnosticKindAssert assertThat(Diagnostic.@Nullable Kind kind) { return assertThatKind(kind); } @@ -184,8 +173,7 @@ public static DiagnosticKindAssert assertThat(@Nullable Diagnostic.Kind kind) { * @param kind the Java file object kind to assert on. * @return the assertion. */ - @CheckReturnValue - public static JavaFileObjectKindAssert assertThat(@Nullable JavaFileObject.Kind kind) { + public static JavaFileObjectKindAssert assertThat(JavaFileObject.@Nullable Kind kind) { return assertThatKind(kind); } @@ -199,7 +187,6 @@ public static JavaFileObjectKindAssert assertThat(@Nullable JavaFileObject.Kind * @param location the location to assert on. * @return the assertion. */ - @CheckReturnValue public static LocationAssert assertThat(@Nullable Location location) { return assertThatLocation(location); } @@ -210,7 +197,6 @@ public static LocationAssert assertThat(@Nullable Location location) { * @param compilation the compilation to assert on. * @return the assertion. */ - @CheckReturnValue public static JctCompilationAssert assertThatCompilation(@Nullable JctCompilation compilation) { return new JctCompilationAssert(compilation); } @@ -221,9 +207,8 @@ public static JctCompilationAssert assertThatCompilation(@Nullable JctCompilatio * @param moduleContainerGroup the module container group to assert on. * @return the assertion. */ - @CheckReturnValue public static ModuleContainerGroupAssert assertThatContainerGroup( - @Nullable ModuleContainerGroup moduleContainerGroup + ModuleContainerGroup moduleContainerGroup ) { return new ModuleContainerGroupAssert(moduleContainerGroup); } @@ -234,9 +219,8 @@ public static ModuleContainerGroupAssert assertThatContainerGroup( * @param outputContainerGroup the output container group to assert on. * @return the assertion. */ - @CheckReturnValue public static OutputContainerGroupAssert assertThatContainerGroup( - @Nullable OutputContainerGroup outputContainerGroup + OutputContainerGroup outputContainerGroup ) { return new OutputContainerGroupAssert(outputContainerGroup); } @@ -247,9 +231,8 @@ public static OutputContainerGroupAssert assertThatContainerGroup( * @param packageContainerGroup the package container group to assert on. * @return the assertion. */ - @CheckReturnValue public static PackageContainerGroupAssert assertThatContainerGroup( - @Nullable PackageContainerGroup packageContainerGroup + PackageContainerGroup packageContainerGroup ) { return new PackageContainerGroupAssert(packageContainerGroup); } @@ -260,9 +243,8 @@ public static PackageContainerGroupAssert assertThatContainerGroup( * @param diagnostic the diagnostic to assert on. * @return the assertion. */ - @CheckReturnValue public static TraceDiagnosticAssert assertThatDiagnostic( - @Nullable TraceDiagnostic diagnostic + TraceDiagnostic diagnostic ) { return new TraceDiagnosticAssert(diagnostic); } @@ -273,9 +255,8 @@ public static TraceDiagnosticAssert assertThatDiagnostic( * @param diagnostics the diagnostics to assert on. * @return the assertion. */ - @CheckReturnValue public static TraceDiagnosticListAssert assertThatDiagnostics( - @Nullable List> diagnostics + List> diagnostics ) { return new TraceDiagnosticListAssert(diagnostics); } @@ -286,7 +267,6 @@ public static TraceDiagnosticListAssert assertThatDiagnostics( * @param fileObject the file object to assert on. * @return the assertion. */ - @CheckReturnValue public static JavaFileObjectAssert assertThatFileObject(@Nullable JavaFileObject fileObject) { return new JavaFileObjectAssert(fileObject); } @@ -297,7 +277,6 @@ public static JavaFileObjectAssert assertThatFileObject(@Nullable JavaFileObject * @param fileObject the file object to assert on. * @return the assertion. */ - @CheckReturnValue public static PathFileObjectAssert assertThatFileObject(@Nullable PathFileObject fileObject) { return new PathFileObjectAssert(fileObject); } @@ -308,8 +287,7 @@ public static PathFileObjectAssert assertThatFileObject(@Nullable PathFileObject * @param kind the diagnostic kind to assert on. * @return the assertion. */ - @CheckReturnValue - public static DiagnosticKindAssert assertThatKind(@Nullable Diagnostic.Kind kind) { + public static DiagnosticKindAssert assertThatKind(Diagnostic.@Nullable Kind kind) { return new DiagnosticKindAssert(kind); } @@ -319,8 +297,7 @@ public static DiagnosticKindAssert assertThatKind(@Nullable Diagnostic.Kind kind * @param kind the Java file object kind to assert on. * @return the assertion. */ - @CheckReturnValue - public static JavaFileObjectKindAssert assertThatKind(@Nullable JavaFileObject.Kind kind) { + public static JavaFileObjectKindAssert assertThatKind(JavaFileObject.@Nullable Kind kind) { return new JavaFileObjectKindAssert(kind); } @@ -330,7 +307,6 @@ public static JavaFileObjectKindAssert assertThatKind(@Nullable JavaFileObject.K * @param location the location to assert on. * @return the assertion. */ - @CheckReturnValue public static LocationAssert assertThatLocation(@Nullable Location location) { return new LocationAssert(location); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctCompilationAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctCompilationAssert.java index e6cb323b8..decc92792 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctCompilationAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/JctCompilationAssert.java @@ -21,15 +21,13 @@ import io.github.ascopes.jct.compilers.JctCompilation; import io.github.ascopes.jct.repr.TraceDiagnosticListRepresentation; import java.util.Collection; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.Diagnostic.Kind; import javax.tools.JavaFileManager.Location; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractAssert; +import org.jspecify.annotations.Nullable; /** * Assertions that apply to a {@link JctCompilation}. @@ -38,7 +36,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JctCompilationAssert extends AbstractAssert { @@ -122,7 +119,6 @@ public JctCompilationAssert isFailure() { * @return assertions for the diagnostics. * @throws AssertionError if the compilation was null. */ - @CheckReturnValue public TraceDiagnosticListAssert diagnostics() { isNotNull(); return new TraceDiagnosticListAssert(actual.getDiagnostics()); @@ -140,7 +136,6 @@ public TraceDiagnosticListAssert diagnostics() { * {@link Location#isModuleOrientedLocation() module-oriented}. * @throws NullPointerException if the provided location object is null. */ - @CheckReturnValue public PackageContainerGroupAssert packageGroup(Location location) { requireNonNull(location, "location must not be null"); @@ -169,7 +164,6 @@ public PackageContainerGroupAssert packageGroup(Location location) { * {@link Location#isModuleOrientedLocation() module-oriented}. * @throws NullPointerException if the provided location object is null. */ - @CheckReturnValue public ModuleContainerGroupAssert moduleGroup(Location location) { requireNonNull(location, "location must not be null"); @@ -198,7 +192,6 @@ public ModuleContainerGroupAssert moduleGroup(Location location) { * {@link Location#isOutputLocation() an output location}. * @throws NullPointerException if the provided location object is null. */ - @CheckReturnValue public OutputContainerGroupAssert outputGroup(Location location) { requireNonNull(location, "location must not be null"); @@ -223,7 +216,6 @@ public OutputContainerGroupAssert outputGroup(Location location) { * @return the assertions to perform on the class outputs. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public OutputContainerGroupAssert classOutput() { return outputGroup(StandardLocation.CLASS_OUTPUT); } @@ -236,7 +228,6 @@ public OutputContainerGroupAssert classOutput() { * @return the assertions to perform on the source outputs. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public OutputContainerGroupAssert sourceOutput() { return outputGroup(StandardLocation.SOURCE_OUTPUT); } @@ -249,7 +240,6 @@ public OutputContainerGroupAssert sourceOutput() { * @return the assertions to perform on the header outputs. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public OutputContainerGroupAssert generatedHeaders() { return outputGroup(StandardLocation.NATIVE_HEADER_OUTPUT); } @@ -262,7 +252,6 @@ public OutputContainerGroupAssert generatedHeaders() { * @return the assertions to perform on the class path. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public PackageContainerGroupAssert classPath() { return packageGroup(StandardLocation.CLASS_PATH); } @@ -275,7 +264,6 @@ public PackageContainerGroupAssert classPath() { * @return the assertions to perform on the source path. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public PackageContainerGroupAssert sourcePath() { return packageGroup(StandardLocation.SOURCE_PATH); } @@ -288,7 +276,6 @@ public PackageContainerGroupAssert sourcePath() { * @return the assertions to perform on the source path. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public ModuleContainerGroupAssert moduleSourcePath() { return moduleGroup(StandardLocation.MODULE_SOURCE_PATH); } @@ -301,7 +288,6 @@ public ModuleContainerGroupAssert moduleSourcePath() { * @return the assertions to perform on the module path. * @throws AssertionError if the compilation is null. */ - @CheckReturnValue public ModuleContainerGroupAssert modulePath() { return moduleGroup(StandardLocation.MODULE_PATH); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/LocationAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/LocationAssert.java index 0a680129c..f04156c30 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/LocationAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/LocationAssert.java @@ -18,14 +18,12 @@ import static org.assertj.core.api.Assertions.assertThat; import io.github.ascopes.jct.repr.LocationRepresentation; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractStringAssert; +import org.jspecify.annotations.Nullable; /** * Assertions for an individual {@link Location location}. @@ -34,7 +32,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class LocationAssert extends AbstractAssert { /** @@ -125,7 +122,6 @@ public LocationAssert isNotOutputLocation() { * @return the string assertions to perform. * @throws AssertionError if the location is null. */ - @CheckReturnValue public AbstractStringAssert name() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ModuleContainerGroupAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ModuleContainerGroupAssert.java index b228a4444..233a911ba 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ModuleContainerGroupAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/ModuleContainerGroupAssert.java @@ -21,12 +21,11 @@ import io.github.ascopes.jct.filemanagers.ModuleLocation; import io.github.ascopes.jct.repr.LocationRepresentation; import java.util.stream.Collectors; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import me.xdrop.fuzzywuzzy.FuzzySearch; import me.xdrop.fuzzywuzzy.model.BoundExtractedResult; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Assertions for module container groups. @@ -35,7 +34,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class ModuleContainerGroupAssert extends AbstractContainerGroupAssert { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/OutputContainerGroupAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/OutputContainerGroupAssert.java index 1b6457838..6ca51926c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/OutputContainerGroupAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/OutputContainerGroupAssert.java @@ -16,11 +16,9 @@ package io.github.ascopes.jct.assertions; import io.github.ascopes.jct.containers.OutputContainerGroup; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Assertions for output container groups. @@ -29,7 +27,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class OutputContainerGroupAssert extends AbstractContainerGroupAssert { @@ -49,7 +46,6 @@ public OutputContainerGroupAssert(@Nullable OutputContainerGroup containerGroup) * @return the package-oriented assertions. * @throws AssertionError if the container group is null. */ - @CheckReturnValue public PackageContainerGroupAssert packages() { isNotNull(); @@ -62,7 +58,6 @@ public PackageContainerGroupAssert packages() { * @return the module-oriented assertions. * @throws AssertionError if the container group is null. */ - @CheckReturnValue public ModuleContainerGroupAssert modules() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PackageContainerGroupAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PackageContainerGroupAssert.java index 269fdb029..96accac74 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PackageContainerGroupAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PackageContainerGroupAssert.java @@ -28,14 +28,12 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.stream.Collectors; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import me.xdrop.fuzzywuzzy.FuzzySearch; import me.xdrop.fuzzywuzzy.model.BoundExtractedResult; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractPathAssert; +import org.jspecify.annotations.Nullable; /** * Assertions for package container groups. @@ -44,7 +42,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class PackageContainerGroupAssert extends AbstractContainerGroupAssert { @@ -95,7 +92,6 @@ public void allFilesExist(Iterable paths) { * @return the assertions to perform. * @throws AssertionError if the container group is null. */ - @CheckReturnValue public ClassLoaderAssert classLoader() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PathFileObjectAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PathFileObjectAssert.java index 2f2bd99f1..836151a60 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PathFileObjectAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/PathFileObjectAssert.java @@ -18,12 +18,10 @@ import static org.assertj.core.api.Assertions.assertThat; import io.github.ascopes.jct.filemanagers.PathFileObject; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractPathAssert; +import org.jspecify.annotations.Nullable; /** * Assertions for {@link PathFileObject Path file objects}. @@ -32,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class PathFileObjectAssert extends AbstractJavaFileObjectAssert { @@ -51,7 +48,6 @@ public PathFileObjectAssert(@Nullable PathFileObject actual) { * @return the assertions for the path. * @throws AssertionError if the file object is null. */ - @CheckReturnValue public AbstractPathAssert relativePath() { isNotNull(); @@ -64,7 +60,6 @@ public AbstractPathAssert relativePath() { * @return the assertions for the path. * @throws AssertionError if the file object is null. */ - @CheckReturnValue public AbstractPathAssert fullPath() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceAssert.java index 55b9e6eca..f1a418d60 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceAssert.java @@ -18,11 +18,10 @@ import io.github.ascopes.jct.repr.StackTraceRepresentation; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractListAssert; +import org.jspecify.annotations.Nullable; /** * Assertions for a list of {@link StackTraceElement stack trace frames}. @@ -34,7 +33,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class StackTraceAssert extends AbstractListAssert, StackTraceElement, StackTraceElementAssert> { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceElementAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceElementAssert.java index 493d53c5e..69eb8dfa9 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceElementAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/StackTraceElementAssert.java @@ -17,15 +17,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.AbstractBooleanAssert; import org.assertj.core.api.AbstractIntegerAssert; import org.assertj.core.api.AbstractStringAssert; +import org.jspecify.annotations.Nullable; /** * Assertions to perform on a {@link StackTraceElement stack trace frame}. @@ -37,7 +35,6 @@ * @since 0.0.1 */ @API(status = Status.EXPERIMENTAL) -@NotThreadSafe public final class StackTraceElementAssert extends AbstractAssert { @@ -56,7 +53,6 @@ public StackTraceElementAssert(@Nullable StackTraceElement actual) { * @return the assertions for the file name. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractStringAssert fileName() { isNotNull(); @@ -73,7 +69,6 @@ public AbstractStringAssert fileName() { * @return the assertions for the line number. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractIntegerAssert lineNumber() { isNotNull(); @@ -89,7 +84,6 @@ public AbstractIntegerAssert lineNumber() { * @return the assertions for the module name. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractStringAssert moduleName() { isNotNull(); @@ -105,7 +99,6 @@ public AbstractStringAssert moduleName() { * @return the assertions for the module version. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractStringAssert moduleVersion() { isNotNull(); @@ -119,7 +112,6 @@ public AbstractStringAssert moduleVersion() { * @return the assertions for the classloader name. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractStringAssert classLoaderName() { isNotNull(); @@ -133,7 +125,6 @@ public AbstractStringAssert classLoaderName() { * @return the assertions for the class name. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractStringAssert className() { isNotNull(); @@ -147,7 +138,6 @@ public AbstractStringAssert className() { * @return the assertions for the method name. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractStringAssert methodName() { isNotNull(); @@ -161,7 +151,6 @@ public AbstractStringAssert methodName() { * @return the assertions for the method nativity. * @throws AssertionError if the stack trace element is null. */ - @CheckReturnValue public AbstractBooleanAssert nativeMethod() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticAssert.java index 443419ff2..ec9dcb9ee 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticAssert.java @@ -21,9 +21,6 @@ import io.github.ascopes.jct.diagnostics.TraceDiagnostic; import io.github.ascopes.jct.repr.TraceDiagnosticRepresentation; import java.util.Locale; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -31,6 +28,7 @@ import org.assertj.core.api.AbstractInstantAssert; import org.assertj.core.api.AbstractLongAssert; import org.assertj.core.api.AbstractStringAssert; +import org.jspecify.annotations.Nullable; /** * Assertions for an individual {@link TraceDiagnostic trace diagnostic}. @@ -39,7 +37,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class TraceDiagnosticAssert extends AbstractAssert> { @@ -59,7 +56,6 @@ public TraceDiagnosticAssert(@Nullable TraceDiagnostic * @return the assertions for the diagnostic kind. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public DiagnosticKindAssert kind() { isNotNull(); @@ -74,7 +70,6 @@ public DiagnosticKindAssert kind() { * @return the assertions for the source of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public JavaFileObjectAssert source() { isNotNull(); @@ -89,7 +84,6 @@ public JavaFileObjectAssert source() { * @return the assertions for the position of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractLongAssert position() { return assertPosition(actual.getPosition(), "position"); } @@ -102,7 +96,6 @@ public AbstractLongAssert position() { * @return the assertions for the start position of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractLongAssert startPosition() { return assertPosition(actual.getPosition(), "startPosition"); } @@ -115,7 +108,6 @@ public AbstractLongAssert startPosition() { * @return the assertions for the end position of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractLongAssert endPosition() { return assertPosition(actual.getEndPosition(), "endPosition"); } @@ -128,7 +120,6 @@ public AbstractLongAssert endPosition() { * @return the assertions for the line number of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractLongAssert lineNumber() { return assertPosition(actual.getLineNumber(), "lineNumber"); } @@ -141,7 +132,6 @@ public AbstractLongAssert lineNumber() { * @return the assertions for the column number of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractLongAssert columnNumber() { return assertPosition(actual.getColumnNumber(), "columnNumber"); } @@ -152,7 +142,6 @@ public AbstractLongAssert columnNumber() { * @return the assertions for the code of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractStringAssert code() { isNotNull(); @@ -165,7 +154,6 @@ public AbstractStringAssert code() { * @return the assertions for the message of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractStringAssert message() { isNotNull(); @@ -179,7 +167,6 @@ public AbstractStringAssert message() { * @return the assertions for the message of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractStringAssert message(Locale locale) { requireNonNull(locale, "locale must not be null"); @@ -194,7 +181,6 @@ public AbstractStringAssert message(Locale locale) { * @return the assertions for the timestamp of the diagnostic. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractInstantAssert timestamp() { isNotNull(); @@ -207,7 +193,6 @@ public AbstractInstantAssert timestamp() { * @return the assertions for the thread ID. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractLongAssert threadId() { isNotNull(); @@ -223,7 +208,6 @@ public AbstractLongAssert threadId() { * @return the assertions for the thread name. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public AbstractStringAssert threadName() { isNotNull(); @@ -236,7 +220,6 @@ public AbstractStringAssert threadName() { * @return the assertions for the stack trace. * @throws AssertionError if the diagnostic is null. */ - @CheckReturnValue public StackTraceAssert stackTrace() { isNotNull(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticListAssert.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticListAssert.java index 65855684e..dfcbdbde2 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticListAssert.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/TraceDiagnosticListAssert.java @@ -30,9 +30,6 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.Diagnostic.Kind; import javax.tools.JavaFileObject; import org.apiguardian.api.API; @@ -46,7 +43,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class TraceDiagnosticListAssert extends AbstractListAssert>, TraceDiagnostic, TraceDiagnosticAssert> { @@ -57,7 +53,7 @@ public final class TraceDiagnosticListAssert * @param traceDiagnostics the diagnostics to perform assertions on. */ public TraceDiagnosticListAssert( - @Nullable List> traceDiagnostics + List> traceDiagnostics ) { super(traceDiagnostics, TraceDiagnosticListAssert.class); info.useRepresentation(TraceDiagnosticListRepresentation.getInstance()); @@ -70,7 +66,6 @@ public TraceDiagnosticListAssert( * @return the assertion object for {@link Kind#ERROR} diagnostics. * @throws AssertionError if the list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert errors() { return filteringByKinds(DiagnosticKindAssert.ERROR_DIAGNOSTIC_KINDS); } @@ -83,7 +78,6 @@ public TraceDiagnosticListAssert errors() { * diagnostics. * @throws AssertionError if the list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert warnings() { return filteringByKinds(DiagnosticKindAssert.WARNING_DIAGNOSTIC_KINDS); } @@ -95,7 +89,6 @@ public TraceDiagnosticListAssert warnings() { * @return the assertion object for {@link Kind#WARNING} diagnostics. * @throws AssertionError if the list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert customWarnings() { return filteringByKinds(Kind.WARNING); } @@ -107,7 +100,6 @@ public TraceDiagnosticListAssert customWarnings() { * @return the assertion object for {@link Kind#MANDATORY_WARNING} diagnostics. * @throws AssertionError if the list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert mandatoryWarnings() { return filteringByKinds(Kind.MANDATORY_WARNING); } @@ -119,7 +111,6 @@ public TraceDiagnosticListAssert mandatoryWarnings() { * @return the assertion object for {@link Kind#NOTE} diagnostics. * @throws AssertionError if the list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert notes() { return filteringByKinds(Kind.NOTE); } @@ -131,7 +122,6 @@ public TraceDiagnosticListAssert notes() { * @return the assertion object for {@link Kind#OTHER} diagnostics. * @throws AssertionError if the list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert others() { return filteringByKinds(Kind.OTHER); } @@ -146,7 +136,6 @@ public TraceDiagnosticListAssert others() { * @throws AssertionError if this list is null. * @throws NullPointerException if any of the kinds are null. */ - @CheckReturnValue public TraceDiagnosticListAssert filteringByKinds(Kind kind, Kind... moreKinds) { requireNonNull(kind, "kind must not be null"); requireNonNullValues(moreKinds, "moreKinds"); @@ -163,7 +152,6 @@ public TraceDiagnosticListAssert filteringByKinds(Kind kind, Kind... moreKinds) * @throws AssertionError if this list is null. * @throws NullPointerException if any of the kinds are null. */ - @CheckReturnValue public TraceDiagnosticListAssert filteringByKinds(Iterable kinds) { requireNonNullValues(kinds, "kinds"); return filteringBy(kind(kinds)); @@ -179,7 +167,6 @@ public TraceDiagnosticListAssert filteringByKinds(Iterable kinds) { * @throws AssertionError if this list is null. * @throws NullPointerException if any of the kinds are null. */ - @CheckReturnValue public TraceDiagnosticListAssert excludingKinds(Kind kind, Kind... moreKinds) { requireNonNull(kind, "kind must not be null"); requireNonNullValues(moreKinds, "moreKinds"); @@ -195,7 +182,6 @@ public TraceDiagnosticListAssert excludingKinds(Kind kind, Kind... moreKinds) { * @throws AssertionError if this list is null. * @throws NullPointerException if any of the kinds are null. */ - @CheckReturnValue public TraceDiagnosticListAssert excludingKinds(Iterable kinds) { requireNonNullValues(kinds, "kinds"); return filteringBy(not(kind(kinds))); @@ -334,7 +320,6 @@ public TraceDiagnosticListAssert hasNoDiagnosticsOfKinds(Iterable kinds) { * @throws NullPointerException if the predicate is null. * @throws AssertionError if the diagnostic list is null. */ - @CheckReturnValue public TraceDiagnosticListAssert filteringBy( Predicate> predicate ) { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/package-info.java index 8c5d3e8f3..1f571c10d 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/assertions/package-info.java @@ -17,11 +17,9 @@ * Assertions to perform on the result of a compilation. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.assertions; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/AbstractJctCompiler.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/AbstractJctCompiler.java index 740a25d85..26a5e58d3 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/AbstractJctCompiler.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/AbstractJctCompiler.java @@ -31,12 +31,10 @@ import java.util.Collection; import java.util.List; import java.util.Locale; -import javax.annotation.Nullable; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.NotThreadSafe; import javax.annotation.processing.Processor; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Common functionality for a compiler that can be overridden and that produces a @@ -57,7 +55,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public abstract class AbstractJctCompiler> implements JctCompiler { @@ -260,7 +257,6 @@ public String getEffectiveRelease() { return getDefaultRelease(); } - @Nullable @Override public String getRelease() { return release; @@ -278,7 +274,6 @@ public A release(@Nullable String release) { return myself(); } - @Nullable @Override public String getSource() { return source; @@ -293,7 +288,6 @@ public A source(@Nullable String source) { return myself(); } - @Nullable @Override public String getTarget() { return target; @@ -522,8 +516,8 @@ protected List buildFlags(JctFlagBuilder flagBuilder) { @SuppressWarnings({"NullableProblems", "ThrowFromFinallyBlock"}) // NullableProblems is needed due to https://youtrack.jetbrains.com/issue/IDEA-311124 private JctCompilation compileInternal( - @WillNotClose Workspace workspace, - @Nullable Collection classNames + Workspace workspace, + Collection classNames ) { var fileManagerFactory = getFileManagerFactory(); var flagBuilderFactory = getFlagBuilderFactory(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/CompilationMode.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/CompilationMode.java index 9792c35e4..beda70c99 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/CompilationMode.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/CompilationMode.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.compilers; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -28,7 +27,6 @@ * @since 0.0.1 (0.0.1-M6) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public enum CompilationMode { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilation.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilation.java index 73ee0cd05..9006d04ab 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilation.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilation.java @@ -22,8 +22,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileObject; import javax.tools.StandardLocation; import org.apiguardian.api.API; @@ -36,7 +34,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface JctCompilation { /** @@ -97,7 +94,6 @@ default boolean isFailure() { * * @return the output container group, or {@code null} if it does not exist. */ - @Nullable default OutputContainerGroup getClassOutputs() { return getFileManager().getOutputContainerGroup(StandardLocation.CLASS_OUTPUT); } @@ -107,7 +103,6 @@ default OutputContainerGroup getClassOutputs() { * * @return the output container group, or {@code null} if it does not exist. */ - @Nullable default OutputContainerGroup getSourceOutputs() { return getFileManager().getOutputContainerGroup(StandardLocation.SOURCE_OUTPUT); } @@ -117,7 +112,6 @@ default OutputContainerGroup getSourceOutputs() { * * @return the package container group, or {@code null} if it does not exist. */ - @Nullable default PackageContainerGroup getClassPath() { return getFileManager().getPackageContainerGroup(StandardLocation.CLASS_PATH); } @@ -127,7 +121,6 @@ default PackageContainerGroup getClassPath() { * * @return the package container group, or {@code null} if it does not exist. */ - @Nullable default PackageContainerGroup getSourcePath() { return getFileManager().getPackageContainerGroup(StandardLocation.SOURCE_PATH); } @@ -137,7 +130,6 @@ default PackageContainerGroup getSourcePath() { * * @return the package container group, or {@code null} if it does not exist. */ - @Nullable default PackageContainerGroup getAnnotationProcessorPath() { return getFileManager().getPackageContainerGroup(StandardLocation.ANNOTATION_PROCESSOR_PATH); } @@ -147,7 +139,6 @@ default PackageContainerGroup getAnnotationProcessorPath() { * * @return the module container group, or {@code null} if it does not exist. */ - @Nullable default ModuleContainerGroup getAnnotationProcessorModulePath() { return getFileManager() .getModuleContainerGroup(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH); @@ -158,7 +149,6 @@ default ModuleContainerGroup getAnnotationProcessorModulePath() { * * @return the package container group, or {@code null} if it does not exist. */ - @Nullable default PackageContainerGroup getPlatformClassPath() { return getFileManager().getPackageContainerGroup(StandardLocation.PLATFORM_CLASS_PATH); } @@ -168,7 +158,6 @@ default PackageContainerGroup getPlatformClassPath() { * * @return the output container group, or {@code null} if it does not exist. */ - @Nullable default OutputContainerGroup getNativeHeaderOutputs() { return getFileManager().getOutputContainerGroup(StandardLocation.NATIVE_HEADER_OUTPUT); } @@ -178,7 +167,6 @@ default OutputContainerGroup getNativeHeaderOutputs() { * * @return the module container group, or {@code null} if it does not exist. */ - @Nullable default ModuleContainerGroup getModuleSourcePath() { return getFileManager().getModuleContainerGroup(StandardLocation.MODULE_SOURCE_PATH); } @@ -188,7 +176,6 @@ default ModuleContainerGroup getModuleSourcePath() { * * @return the module container group, or {@code null} if it does not exist. */ - @Nullable default ModuleContainerGroup getUpgradeModulePath() { return getFileManager().getModuleContainerGroup(StandardLocation.UPGRADE_MODULE_PATH); } @@ -198,7 +185,6 @@ default ModuleContainerGroup getUpgradeModulePath() { * * @return the module container group, or {@code null} if it does not exist. */ - @Nullable default ModuleContainerGroup getSystemModules() { return getFileManager().getModuleContainerGroup(StandardLocation.SYSTEM_MODULES); } @@ -208,7 +194,6 @@ default ModuleContainerGroup getSystemModules() { * * @return the module container group, or {@code null} if it does not exist. */ - @Nullable default ModuleContainerGroup getModulePath() { return getFileManager().getModuleContainerGroup(StandardLocation.MODULE_PATH); } @@ -218,7 +203,6 @@ default ModuleContainerGroup getModulePath() { * * @return the module container group, or {@code null} if it does not exist. */ - @Nullable default ModuleContainerGroup getPatchModulePath() { return getFileManager().getModuleContainerGroup(StandardLocation.PATCH_MODULE_PATH); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilationFactory.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilationFactory.java index 70ef77aeb..58de36bcf 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilationFactory.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilationFactory.java @@ -19,7 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import java.util.Collection; import java.util.List; -import javax.annotation.Nullable; import javax.tools.JavaCompiler; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -50,6 +49,6 @@ JctCompilation createCompilation( List flags, JctFileManager fileManager, JavaCompiler jsr199Compiler, - @Nullable Collection classNames + Collection classNames ); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompiler.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompiler.java index 5091a29de..a1731370e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompiler.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompiler.java @@ -26,8 +26,6 @@ import java.util.Collection; import java.util.List; import java.util.Locale; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.annotation.processing.Processor; import javax.lang.model.SourceVersion; import org.apiguardian.api.API; @@ -44,7 +42,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface JctCompiler, R extends JctCompilation> { /** @@ -480,7 +477,6 @@ default C addCompilerOptions(String compilerOption, String... compilerOptions) { * * @return the release version string, if set. */ - @Nullable String getRelease(); /** @@ -539,7 +535,6 @@ default C release(SourceVersion release) { * * @return the source version string, if set. */ - @Nullable String getSource(); /** @@ -597,7 +592,6 @@ default C source(SourceVersion source) { * * @return the target version string, if set. */ - @Nullable String getTarget(); /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilerConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilerConfigurer.java index a566abbd9..91e6dcf57 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilerConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilerConfigurer.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.compilers; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -94,7 +93,6 @@ */ @API(since = "0.0.1", status = Status.STABLE) @FunctionalInterface -@NotThreadSafe @SuppressWarnings("NullableProblems") public interface JctCompilerConfigurer { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilers.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilers.java index d1a0f5387..4e1192e20 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilers.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctCompilers.java @@ -17,7 +17,6 @@ import io.github.ascopes.jct.compilers.javac.JavacJctCompilerImpl; import io.github.ascopes.jct.utils.UtilityClass; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -28,7 +27,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctCompilers extends UtilityClass { private JctCompilers() { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctFlagBuilder.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctFlagBuilder.java index 75660361d..aab4cd98f 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctFlagBuilder.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/JctFlagBuilder.java @@ -16,10 +16,9 @@ package io.github.ascopes.jct.compilers; import java.util.List; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Interface for defining a common flag builder for compilers. @@ -27,7 +26,6 @@ * @author Ashley Scopes */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public interface JctFlagBuilder { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactoryImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactoryImpl.java index 2523b3231..f6259af25 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactoryImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationFactoryImpl.java @@ -33,9 +33,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaCompiler; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; @@ -54,7 +51,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class JctCompilationFactoryImpl implements JctCompilationFactory { private static final Logger LOGGER = LoggerFactory.getLogger(JctCompilationFactoryImpl.class); @@ -70,7 +66,7 @@ public JctCompilation createCompilation( List flags, JctFileManager fileManager, JavaCompiler jsr199Compiler, - @Nullable Collection classNames + Collection classNames ) { try { return createCheckedCompilation(flags, fileManager, jsr199Compiler, classNames); @@ -88,12 +84,11 @@ private JctCompilation createCheckedCompilation( List flags, JctFileManager fileManager, JavaCompiler jsr199Compiler, - @Nullable Collection classNames + Collection classNames ) throws Exception { var compilationUnits = findCompilationUnits(fileManager); // Do not close stdout, it breaks test engines, especially IntellIJ. - @WillNotClose var writer = new TeeWriter(new OutputStreamWriter(System.out, compiler.getLogCharset())); var diagnosticListener = new TracingDiagnosticListener<>( diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationImpl.java index bcf16cdeb..9363820fd 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/JctCompilationImpl.java @@ -26,9 +26,6 @@ import io.github.ascopes.jct.utils.ToStringBuilder; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -40,7 +37,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class JctCompilationImpl implements JctCompilation { private final boolean success; @@ -129,23 +125,11 @@ public static Builder builder() { @API(since = "0.0.1", status = Status.INTERNAL) public static final class Builder { - @Nullable private Boolean failOnWarnings; - - @Nullable private Boolean success; - - @Nullable private List outputLines; - - @Nullable private Set compilationUnits; - - @Nullable private List> diagnostics; - - @Nullable - @WillNotClose private JctFileManager fileManager; private Builder() { @@ -218,10 +202,12 @@ public Builder diagnostics( /** * Set the file manager. * + *

The file manager will not be closed once finshed with. + * * @param fileManager the file manager. * @return this builder. */ - public Builder fileManager(@WillNotClose JctFileManager fileManager) { + public Builder fileManager(JctFileManager fileManager) { this.fileManager = requireNonNull(fileManager, "fileManager"); return this; } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/package-info.java index a0842f78f..fc94fe6a9 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/impl/package-info.java @@ -17,11 +17,9 @@ * Internal common shared compiler components. */ @API(since = "0.0.1", status = Status.INTERNAL) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.compilers.impl; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctCompilerImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctCompilerImpl.java index e138b369a..cd05bde5a 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctCompilerImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctCompilerImpl.java @@ -22,7 +22,6 @@ import io.github.ascopes.jct.compilers.Jsr199CompilerFactory; import io.github.ascopes.jct.filemanagers.JctFileManagerFactory; import io.github.ascopes.jct.filemanagers.impl.JctFileManagerFactoryImpl; -import javax.annotation.concurrent.NotThreadSafe; import javax.lang.model.SourceVersion; import javax.tools.ToolProvider; import org.apiguardian.api.API; @@ -35,7 +34,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@NotThreadSafe public final class JavacJctCompilerImpl extends AbstractJctCompiler { private static final String NAME = "JDK Compiler"; @@ -87,6 +85,7 @@ public static int getEarliestSupportedVersionInt(boolean modules) { var latestSupported = SourceVersion.latestSupported().ordinal(); + //noinspection NonStrictComparisonCanBeEquality if (latestSupported >= 20) { // JDK 20 marks source-version 8 as obsolete, and emits compilation // warnings that may break tests using "fail on warnings". To avoid this, diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctFlagBuilderImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctFlagBuilderImpl.java index 10112dffe..70935ff41 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctFlagBuilderImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/JavacJctFlagBuilderImpl.java @@ -19,10 +19,9 @@ import io.github.ascopes.jct.compilers.JctFlagBuilder; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Helper to build flags for a standard Javac implementation for the OpenJDK. @@ -31,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@NotThreadSafe public final class JavacJctFlagBuilderImpl implements JctFlagBuilder { private static final String VERBOSE = "-verbose"; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/package-info.java index 87ea1d983..e260a7946 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/javac/package-info.java @@ -17,11 +17,9 @@ * Internal Javac compiler integrations. */ @API(since = "0.0.1", status = Status.INTERNAL) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.compilers.javac; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/package-info.java index 86a9c2340..b69be19ca 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/compilers/package-info.java @@ -17,11 +17,9 @@ * Compiler frontends that allow invoking compilers easily from tests. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.compilers; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/Container.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/Container.java index 6850c1e9a..e61add58f 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/Container.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/Container.java @@ -23,8 +23,6 @@ import java.nio.file.Path; import java.util.Collection; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.FileObject; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; @@ -42,7 +40,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface Container extends Closeable { /** @@ -70,7 +67,6 @@ public interface Container extends Closeable { * @param fragments any additional parts of the file name to find. * @return the path if the file exists, or null if it does not exist. */ - @Nullable Path getFile(String fragment, String... fragments); /** @@ -82,7 +78,6 @@ public interface Container extends Closeable { * @param relativeName the relative name of the file in the package. * @return the file object, or null if it does not exist. */ - @Nullable PathFileObject getFileForInput(String packageName, String relativeName); /** @@ -94,7 +89,6 @@ public interface Container extends Closeable { * @param relativeName the relative name of the file in the package. * @return the file object, or null if this container is read-only. */ - @Nullable PathFileObject getFileForOutput(String packageName, String relativeName); /** @@ -106,7 +100,6 @@ public interface Container extends Closeable { * @param kind the kind of file to open. * @return the file object, or null if it does not exist. */ - @Nullable PathFileObject getJavaFileForInput(String className, Kind kind); /** @@ -118,7 +111,6 @@ public interface Container extends Closeable { * @param kind the kind of file to open. * @return the file object, or null if this container is read-only. */ - @Nullable PathFileObject getJavaFileForOutput(String className, Kind kind); /** @@ -136,7 +128,6 @@ public interface Container extends Closeable { * @return the module finder for this container, or {@code null} if not relevant to the * implementation. */ - @Nullable ModuleFinder getModuleFinder(); /** @@ -159,7 +150,6 @@ public interface Container extends Closeable { * @param javaFileObject the Java file object to infer the binary name of. * @return the name, or null if the file does not exist in this container. */ - @Nullable String inferBinaryName(PathFileObject javaFileObject); /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ContainerGroup.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ContainerGroup.java index 439caab68..0f9adfe25 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ContainerGroup.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ContainerGroup.java @@ -18,7 +18,6 @@ import io.github.ascopes.jct.filemanagers.PathFileObject; import java.io.Closeable; import java.util.ServiceLoader; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -33,7 +32,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface ContainerGroup extends Closeable { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ModuleContainerGroup.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ModuleContainerGroup.java index bc28404bd..416e22212 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ModuleContainerGroup.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/ModuleContainerGroup.java @@ -19,13 +19,10 @@ import io.github.ascopes.jct.workspaces.PathRoot; import java.util.Map; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.WillClose; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * A container group implementation that holds zero or more modules. @@ -37,7 +34,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface ModuleContainerGroup extends ContainerGroup { /** @@ -48,7 +44,7 @@ public interface ModuleContainerGroup extends ContainerGroup { * @param module the module that the container is for. * @param container the container to add. */ - void addModule(String module, @WillClose Container container); + void addModule(String module, Container container); /** * Add a path to this group for a module. @@ -56,7 +52,7 @@ public interface ModuleContainerGroup extends ContainerGroup { * @param module the name of the module that this is for. * @param path the path to add. */ - void addModule(String module, @WillNotClose PathRoot path); + void addModule(String module, PathRoot path); /** * Find the package container group for the given module. diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/OutputContainerGroup.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/OutputContainerGroup.java index f8c0ab79d..5ced1461a 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/OutputContainerGroup.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/OutputContainerGroup.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.containers; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -34,7 +33,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface OutputContainerGroup extends PackageContainerGroup, ModuleContainerGroup { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/PackageContainerGroup.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/PackageContainerGroup.java index 5de5bb51e..15dc34f6d 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/PackageContainerGroup.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/PackageContainerGroup.java @@ -21,10 +21,6 @@ import java.nio.file.Path; import java.util.List; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.WillCloseWhenClosed; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.FileObject; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; @@ -39,7 +35,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface PackageContainerGroup extends ContainerGroup { /** @@ -49,7 +44,7 @@ public interface PackageContainerGroup extends ContainerGroup { * * @param container the container to add. */ - void addPackage(@WillCloseWhenClosed Container container); + void addPackage(Container container); /** * Add a path to this group. @@ -66,7 +61,7 @@ public interface PackageContainerGroup extends ContainerGroup { * * @param path the path to add. */ - void addPackage(@WillNotClose PathRoot path); + void addPackage(PathRoot path); /** * Get a class loader for this group of containers. @@ -96,7 +91,6 @@ public interface PackageContainerGroup extends ContainerGroup { * @return the first occurrence of the path in this group, or null if not found. * @throws IllegalArgumentException if the provided path is absolute. */ - @Nullable Path getFile(String fragment, String... fragments); /** @@ -108,7 +102,6 @@ public interface PackageContainerGroup extends ContainerGroup { * @param relativeName the relative name of the file to read. * @return the file object, or null if the file is not found. */ - @Nullable PathFileObject getFileForInput(String packageName, String relativeName); /** @@ -122,7 +115,6 @@ public interface PackageContainerGroup extends ContainerGroup { * @return the {@link FileObject} to write to, or null if this group has no paths that can be * written to. */ - @Nullable PathFileObject getFileForOutput(String packageName, String relativeName); /** @@ -135,7 +127,6 @@ public interface PackageContainerGroup extends ContainerGroup { * @return the {@link JavaFileObject} to write to, or null if this group has no paths that can be * written to. */ - @Nullable PathFileObject getJavaFileForInput(String className, Kind kind); /** @@ -149,7 +140,6 @@ public interface PackageContainerGroup extends ContainerGroup { * @return the {@link JavaFileObject} to write to, or null if this group has no paths that can be * written to. */ - @Nullable PathFileObject getJavaFileForOutput(String className, Kind kind); /** @@ -175,7 +165,6 @@ public interface PackageContainerGroup extends ContainerGroup { * @param fileObject the file object to infer the binary name for. * @return the binary name if known, or null otherwise. */ - @Nullable String inferBinaryName(PathFileObject fileObject); /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/AbstractPackageContainerGroup.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/AbstractPackageContainerGroup.java index 7327b7a25..4119c7f74 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/AbstractPackageContainerGroup.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/AbstractPackageContainerGroup.java @@ -34,8 +34,6 @@ import java.util.Locale; import java.util.ServiceLoader; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; @@ -53,7 +51,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public abstract class AbstractPackageContainerGroup implements PackageContainerGroup { // https://docs.oracle.com/cd/E19830-01/819-4712/ablgz/index.html @@ -147,7 +144,6 @@ public void close() throws IOException { } @Override - @Nullable public Path getFile(String fragment, String... fragments) { for (var container : containers) { var result = container.getFile(fragment, fragments); @@ -165,7 +161,6 @@ public ClassLoader getClassLoader() { } @Override - @Nullable public PathFileObject getFileForInput(String packageName, String relativeName) { for (var container : containers) { var file = container.getFileForInput(packageName, relativeName); @@ -178,7 +173,6 @@ public PathFileObject getFileForInput(String packageName, String relativeName) { } @Override - @Nullable public PathFileObject getFileForOutput(String packageName, String relativeName) { for (var container : containers) { var file = container.getFileForOutput(packageName, relativeName); @@ -191,7 +185,6 @@ public PathFileObject getFileForOutput(String packageName, String relativeName) } @Override - @Nullable public PathFileObject getJavaFileForInput(String className, Kind kind) { for (var container : containers) { var file = container.getJavaFileForInput(className, kind); @@ -204,7 +197,6 @@ public PathFileObject getJavaFileForInput(String className, Kind kind) { } @Override - @Nullable public PathFileObject getJavaFileForOutput(String className, Kind kind) { for (var container : containers) { var file = container.getJavaFileForOutput(className, kind); @@ -241,7 +233,6 @@ public ServiceLoader getServiceLoader(Class service) { } @Override - @Nullable public String inferBinaryName(PathFileObject fileObject) { for (var container : containers) { var name = container.inferBinaryName(fileObject); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ContainerGroupRepositoryImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ContainerGroupRepositoryImpl.java index 1ca23b9df..142d34c65 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ContainerGroupRepositoryImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ContainerGroupRepositoryImpl.java @@ -27,9 +27,6 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import javax.annotation.Nullable; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -43,7 +40,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class ContainerGroupRepositoryImpl implements AutoCloseable { private static final Logger LOGGER = LoggerFactory.getLogger(ContainerGroupRepositoryImpl.class); @@ -168,7 +164,6 @@ public void flush() { * @param location the location to get the container group for. * @return the container group, or {@code null} if no group is associated with the location. */ - @Nullable public ContainerGroup getContainerGroup(Location location) { ContainerGroup group = outputs.get(location); if (group == null) { @@ -187,7 +182,6 @@ public ContainerGroup getContainerGroup(Location location) { * @param location the location associated with the group to get. * @return the container group, or {@code null} if no group is associated with the location. */ - @Nullable public PackageContainerGroup getPackageContainerGroup(Location location) { return packageInputs.get(location); } @@ -210,7 +204,6 @@ public Collection getPackageContainerGroups() { * @param location the location associated with the group to get. * @return the container group, or {@code null} if no group is associated with the location. */ - @Nullable public PackageContainerGroup getPackageOrientedContainerGroup(Location location) { if (location instanceof ModuleLocation) { var moduleLocation = (ModuleLocation) location; @@ -232,7 +225,6 @@ public PackageContainerGroup getPackageOrientedContainerGroup(Location location) * @param location the location associated with the group to get. * @return the container group, or {@code null} if no group is associated with the location. */ - @Nullable public ModuleContainerGroup getModuleContainerGroup(Location location) { return moduleInputs.get(location); } @@ -252,7 +244,6 @@ public Collection getModuleContainerGroups() { * @param location the location associated with the group to get. * @return the container group, or {@code null} if no group is associated with the location. */ - @Nullable public ModuleContainerGroup getModuleOrientedContainerGroup(Location location) { var group = moduleInputs.get(location); return group == null ? outputs.get(location) : group; @@ -264,7 +255,6 @@ public ModuleContainerGroup getModuleOrientedContainerGroup(Location location) { * @param location the location associated with the group to get. * @return the container group, or {@code null} if no group is associated with the location. */ - @Nullable public OutputContainerGroup getOutputContainerGroup(Location location) { return outputs.get(location); } @@ -402,7 +392,6 @@ private void copyModuleContainers(Location from, Location to) { .forEach(container -> target.addModule(moduleLocation.getModuleName(), container))); } - @WillNotClose private PackageContainerGroup getOrCreatePackageContainerGroup(Location location) { return packageInputs.computeIfAbsent( location, @@ -410,7 +399,6 @@ private PackageContainerGroup getOrCreatePackageContainerGroup(Location location ); } - @WillNotClose private ModuleContainerGroup getOrCreateModuleContainerGroup(Location location) { return moduleInputs.computeIfAbsent( location, @@ -418,7 +406,6 @@ private ModuleContainerGroup getOrCreateModuleContainerGroup(Location location) ); } - @WillNotClose private OutputContainerGroup getOrCreateOutputContainerGroup(Location location) { return outputs.computeIfAbsent( location, diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/JarContainerImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/JarContainerImpl.java index 961cf96c3..6f2d13365 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/JarContainerImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/JarContainerImpl.java @@ -40,9 +40,6 @@ import java.util.Set; import java.util.stream.Stream; import java.util.stream.StreamSupport; -import javax.annotation.Nullable; -import javax.annotation.WillCloseWhenClosed; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; @@ -66,7 +63,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class JarContainerImpl implements Container { private static final Logger LOGGER = LoggerFactory.getLogger(JarContainerImpl.class); @@ -120,7 +116,6 @@ public Path getFile(String fragment, String... fragments) { } @Override - @Nullable public PathFileObject getFileForInput(String packageName, String relativeName) { var packageObj = holder.access().getPackage(packageName); @@ -138,13 +133,11 @@ public PathFileObject getFileForInput(String packageName, String relativeName) { } @Override - @Nullable public PathFileObject getFileForOutput(String packageName, String relativeName) { throw new UnsupportedOperationException("Cannot handle output files in JARs"); } @Override - @Nullable public PathFileObject getJavaFileForInput(String binaryName, Kind kind) { var packageName = FileUtils.binaryNameToPackageName(binaryName); var className = FileUtils.binaryNameToSimpleClassName(binaryName); @@ -165,7 +158,6 @@ public PathFileObject getJavaFileForInput(String binaryName, Kind kind) { } @Override - @Nullable public PathFileObject getJavaFileForOutput(String className, Kind kind) { throw new UnsupportedOperationException("Cannot handle output source files in JARs"); } @@ -195,7 +187,6 @@ public PathRoot getPathRoot() { } @Override - @Nullable public String inferBinaryName(PathFileObject javaFileObject) { // For some reason, converting a zip entry to a URI gives us a scheme of `jar://file://`, but // we cannot then parse the URI back to a path without removing the `file://` bit first. Since @@ -255,7 +246,7 @@ public String toString() { private final class PackageFileSystemHolder { private final Map packages; - private final @WillCloseWhenClosed FileSystem fileSystem; + private final FileSystem fileSystem; private PackageFileSystemHolder() throws IOException { // It turns out that we can open more than one ZIP file system pointing to the @@ -313,7 +304,6 @@ private Map getPackages() { return packages; } - @Nullable private PathRoot getPackage(String name) { return packages.get(name); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ModuleContainerGroupImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ModuleContainerGroupImpl.java index 218ebfb9b..5b685d624 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ModuleContainerGroupImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/ModuleContainerGroupImpl.java @@ -34,9 +34,6 @@ import java.util.ServiceLoader; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import javax.annotation.Nullable; -import javax.annotation.WillCloseWhenClosed; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -48,7 +45,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class ModuleContainerGroupImpl implements ModuleContainerGroup { private final Location location; @@ -87,7 +83,7 @@ public ModuleContainerGroupImpl(Location location, String release) { } @Override - public void addModule(String module, @WillCloseWhenClosed Container container) { + public void addModule(String module, Container container) { getOrCreateModule(module).addPackage(container); } @@ -139,7 +135,6 @@ public Set getLocationsForModules() { return Set.copyOf(modules.keySet()); } - @Nullable @Override public PackageContainerGroup getModule(String name) { if (name.isEmpty()) { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/OutputContainerGroupImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/OutputContainerGroupImpl.java index 9165d4739..1654be04d 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/OutputContainerGroupImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/OutputContainerGroupImpl.java @@ -29,12 +29,10 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; -import javax.annotation.WillCloseWhenClosed; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * A group of containers that relate to a specific output location. @@ -50,7 +48,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class OutputContainerGroupImpl extends AbstractPackageContainerGroup implements OutputContainerGroup { @@ -85,7 +82,7 @@ public OutputContainerGroupImpl(Location location, String release) { } @Override - public void addModule(String module, @WillCloseWhenClosed Container container) { + public void addModule(String module, Container container) { getOrCreateModule(module).addPackage(container); } @@ -106,6 +103,7 @@ public boolean contains(PathFileObject fileObject) { return super.contains(fileObject); } + @Nullable @Override public PackageContainerGroup getModule(String module) { if (module.isEmpty()) { @@ -144,7 +142,6 @@ public boolean hasLocation(ModuleLocation location) { } @SuppressWarnings("resource") - @WillNotClose private PackageContainerGroup newPackageGroup(ModuleLocation moduleLocation) { // For output locations, we only need the first root. We then just put a subdirectory // in there, as it reduces the complexity of this tenfold and means we don't have to diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupImpl.java index 734958685..3266e4dcd 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupImpl.java @@ -16,7 +16,6 @@ package io.github.ascopes.jct.containers.impl; import io.github.ascopes.jct.utils.StringUtils; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -32,7 +31,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class PackageContainerGroupImpl extends AbstractPackageContainerGroup { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupUrlClassLoader.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupUrlClassLoader.java index 9776d048b..40aa0abbe 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupUrlClassLoader.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupUrlClassLoader.java @@ -20,7 +20,6 @@ import io.github.ascopes.jct.workspaces.PathRoot; import java.net.URL; import java.net.URLClassLoader; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -31,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class PackageContainerGroupUrlClassLoader extends URLClassLoader { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PathWrappingContainerImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PathWrappingContainerImpl.java index b351d4027..fc078c35e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PathWrappingContainerImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PathWrappingContainerImpl.java @@ -31,9 +31,6 @@ import java.util.Collection; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.Nullable; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; @@ -49,13 +46,12 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class PathWrappingContainerImpl implements Container { private static final Logger LOGGER = LoggerFactory.getLogger(PathWrappingContainerImpl.class); private final Location location; - private final @WillNotClose PathRoot root; + private final PathRoot root; private final String name; /** @@ -64,7 +60,7 @@ public final class PathWrappingContainerImpl implements Container { * @param location the location. * @param root the root directory to hold. */ - public PathWrappingContainerImpl(Location location, @WillNotClose PathRoot root) { + public PathWrappingContainerImpl(Location location, PathRoot root) { this.location = requireNonNull(location, "location"); this.root = requireNonNull(root, "root"); name = root.toString(); @@ -83,7 +79,6 @@ public boolean contains(PathFileObject fileObject) { } @Override - @Nullable public Path getFile(String fragment, String... fragments) { var realPath = FileUtils.relativeResourceNameToPath(root.getPath(), fragment, fragments); @@ -93,7 +88,6 @@ public Path getFile(String fragment, String... fragments) { } @Override - @Nullable public PathFileObject getFileForInput(String packageName, String relativeName) { var path = FileUtils.resourceNameToPath(root.getPath(), packageName, relativeName); @@ -109,7 +103,6 @@ public PathFileObject getFileForOutput(String packageName, String relativeName) } @Override - @Nullable public PathFileObject getJavaFileForInput(String binaryName, Kind kind) { var path = FileUtils.binaryNameToPath(root.getPath(), binaryName, kind); return Files.isRegularFile(path) @@ -144,7 +137,6 @@ public PathRoot getPathRoot() { } @Override - @Nullable public String inferBinaryName(PathFileObject javaFileObject) { return javaFileObject.getFullPath().startsWith(root.getPath()) ? FileUtils.pathToBinaryName(javaFileObject.getRelativePath()) diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/package-info.java index 8fd5f6c48..6311f7a9e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/package-info.java @@ -17,11 +17,9 @@ * Container and container group implementations. */ @API(since = "0.0.1", status = Status.INTERNAL) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.containers.impl; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/package-info.java index d0b416125..e93a3eb9f 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/package-info.java @@ -17,11 +17,9 @@ * Containers used to integrate with the JSR-199 API in a modular way. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.containers; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TeeWriter.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TeeWriter.java index 9c74cc8eb..8618871ae 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TeeWriter.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TeeWriter.java @@ -19,8 +19,6 @@ import java.io.IOException; import java.io.Writer; -import javax.annotation.WillCloseWhenClosed; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -33,14 +31,13 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class TeeWriter extends Writer { private final Object lock; private volatile boolean closed; - private final @WillCloseWhenClosed Writer writer; + private final Writer writer; // We use a StringBuilder and manually synchronise it rather than // a string buffer, as we want to manually synchronise the builder @@ -52,7 +49,7 @@ public final class TeeWriter extends Writer { * * @param writer the underlying writer to "tee" to. */ - public TeeWriter(@WillCloseWhenClosed Writer writer) { + public TeeWriter(Writer writer) { lock = new Object(); closed = false; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TraceDiagnostic.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TraceDiagnostic.java index 2bb167714..0ab23604a 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TraceDiagnostic.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TraceDiagnostic.java @@ -22,12 +22,11 @@ import java.time.Instant; import java.util.List; import java.util.Locale; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.Diagnostic; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * A wrapper around a {@link Diagnostic} which contains additional information about where the @@ -38,7 +37,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public class TraceDiagnostic implements Diagnostic { private final Instant timestamp; @@ -59,7 +57,7 @@ public class TraceDiagnostic implements Diagnostic public TraceDiagnostic( Instant timestamp, long threadId, - @Nullable String threadName, + String threadName, List stackTrace, Diagnostic original ) { @@ -75,7 +73,6 @@ public Kind getKind() { return original.getKind(); } - @Nullable @Override public S getSource() { return original.getSource(); @@ -106,7 +103,6 @@ public long getColumnNumber() { return original.getColumnNumber(); } - @Nullable @Override public String getCode() { return original.getCode(); @@ -140,7 +136,6 @@ public long getThreadId() { * * @return the thread name, if known, or else {@code null}. */ - @Nullable public String getThreadName() { return threadName; } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TracingDiagnosticListener.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TracingDiagnosticListener.java index 04ba74f22..0145129d3 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TracingDiagnosticListener.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/TracingDiagnosticListener.java @@ -25,7 +25,6 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.Diagnostic; import javax.tools.DiagnosticListener; import javax.tools.JavaFileObject; @@ -44,7 +43,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public class TracingDiagnosticListener implements DiagnosticListener { private final ConcurrentLinkedQueue> diagnostics; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/package-info.java index e050861fd..fab27cc33 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/diagnostics/package-info.java @@ -17,11 +17,9 @@ * Support for collecting and representing diagnostics from compiler implementations. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.diagnostics; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctCompilerException.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctCompilerException.java index 92613bda5..23b59e1c1 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctCompilerException.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctCompilerException.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.ex; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -26,7 +25,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JctCompilerException extends JctException { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctException.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctException.java index e8d0c0fd0..ecf348141 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctException.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctException.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.ex; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -26,7 +25,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public abstract class JctException extends RuntimeException { JctException(String message) { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctJunitConfigurerException.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctJunitConfigurerException.java index 2153d2ffc..854bfbaaf 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctJunitConfigurerException.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/JctJunitConfigurerException.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.ex; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -27,7 +26,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JctJunitConfigurerException extends JctException { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/package-info.java index 080623883..65a090922 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/ex/package-info.java @@ -17,11 +17,9 @@ * Exceptions used within this API. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.ex; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/AnnotationProcessorDiscovery.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/AnnotationProcessorDiscovery.java index 3c735f932..a488063a7 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/AnnotationProcessorDiscovery.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/AnnotationProcessorDiscovery.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.filemanagers; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -26,7 +25,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public enum AnnotationProcessorDiscovery { /** * Discovery is enabled, and will also scan any dependencies in the classpath or module path. diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManager.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManager.java index 64349335f..cff99bf21 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManager.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManager.java @@ -22,8 +22,6 @@ import java.io.IOException; import java.util.Collection; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; @@ -38,7 +36,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface JctFileManager extends JavaFileManager { /** @@ -91,7 +88,6 @@ public interface JctFileManager extends JavaFileManager { * @param location the package oriented location. * @return the container group, or null if one does not exist. */ - @Nullable PackageContainerGroup getPackageContainerGroup(Location location); /** @@ -107,7 +103,6 @@ public interface JctFileManager extends JavaFileManager { * @param location the module oriented location. * @return the container group, or null if one does not exist. */ - @Nullable ModuleContainerGroup getModuleContainerGroup(Location location); /** @@ -123,7 +118,6 @@ public interface JctFileManager extends JavaFileManager { * @param location the output oriented location. * @return the container group, or null if one does not exist. */ - @Nullable OutputContainerGroup getOutputContainerGroup(Location location); /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManagerFactory.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManagerFactory.java index aa36db8a3..08fdd1d7e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManagerFactory.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/JctFileManagerFactory.java @@ -16,7 +16,6 @@ package io.github.ascopes.jct.filemanagers; import io.github.ascopes.jct.workspaces.Workspace; -import javax.annotation.WillNotClose; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -36,6 +35,5 @@ public interface JctFileManagerFactory { * @param workspace the workspace to access files in. * @return the file manager. */ - @WillNotClose - JctFileManager createFileManager(@WillNotClose Workspace workspace); + JctFileManager createFileManager(Workspace workspace); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingFileManagerProxy.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingFileManagerProxy.java index aa40c34ba..7e5e86ab3 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingFileManagerProxy.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingFileManagerProxy.java @@ -25,13 +25,9 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.WillCloseWhenClosed; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -48,7 +44,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class LoggingFileManagerProxy implements InvocationHandler { private final Logger logger; @@ -74,7 +69,7 @@ private LoggingFileManagerProxy(JctFileManager inner, boolean stackTraces) { * @throws Throwable any exception that is thrown. */ @Override - public Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable { + public Object invoke(Object proxy, Method method, Object @Nullable ... args) throws Throwable { if (method.getName().equals("toString")) { return toString(); } @@ -196,12 +191,7 @@ private Supplier stackTraceFormatter(StackTraceElement[] stackTrace) { * omit them. * @return the proxy {@link JctFileManager} to use. */ - @CheckReturnValue - @WillNotClose - public static JctFileManager wrap( - @WillCloseWhenClosed JctFileManager manager, - boolean stackTraces - ) { + public static JctFileManager wrap(JctFileManager manager, boolean stackTraces) { return (JctFileManager) Proxy.newProxyInstance( JctFileManager.class.getClassLoader(), new Class[]{JctFileManager.class}, diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingMode.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingMode.java index 94ab297a6..e0d809d03 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingMode.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/LoggingMode.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.filemanagers; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -26,7 +25,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public enum LoggingMode { /** * Enable basic logging. diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/ModuleLocation.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/ModuleLocation.java index 7ec9eedad..1f50e25ea 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/ModuleLocation.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/ModuleLocation.java @@ -17,11 +17,10 @@ import io.github.ascopes.jct.utils.ToStringBuilder; import java.util.Objects; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Handle that represents the location of a module. @@ -30,7 +29,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class ModuleLocation implements Location { private final Location parent; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/PathFileObject.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/PathFileObject.java index 6b77a18a0..918d4074c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/PathFileObject.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/PathFileObject.java @@ -38,9 +38,6 @@ import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; -import javax.annotation.Nullable; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.lang.model.element.Modifier; import javax.lang.model.element.NestingKind; import javax.tools.FileObject; @@ -48,6 +45,7 @@ import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -62,7 +60,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class PathFileObject implements JavaFileObject { private static final Logger LOGGER = LoggerFactory.getLogger(PathFileObject.class); @@ -146,7 +143,6 @@ public boolean equals(@Nullable Object other) { * * @return {@code null}, always. This implementation does not provide this functionality. */ - @Nullable @Override public Modifier getAccessLevel() { return unknown(); @@ -235,7 +231,6 @@ public String getName() { * * @return {@code null} in all cases, this operation is not implemented. */ - @Nullable @Override public NestingKind getNestingKind() { return unknown(); @@ -299,7 +294,6 @@ public boolean isNameCompatible(String simpleName, Kind kind) { * @throws IOException if an IO error occurs. */ @Override - @WillNotClose public BufferedInputStream openInputStream() throws IOException { return new BufferedInputStream(openUnbufferedInputStream()); } @@ -319,7 +313,6 @@ public BufferedInputStream openInputStream() throws IOException { * @throws IOException if an IO error occurs. */ @Override - @WillNotClose public BufferedOutputStream openOutputStream() throws IOException { return new BufferedOutputStream(openUnbufferedOutputStream()); } @@ -339,7 +332,6 @@ public BufferedOutputStream openOutputStream() throws IOException { * @throws IOException if an IO error occurs. */ @Override - @WillNotClose public BufferedReader openReader(boolean ignoreEncodingErrors) throws IOException { var inputStream = openUnbufferedInputStream(); var decoder = decoder(ignoreEncodingErrors); @@ -362,7 +354,6 @@ public BufferedReader openReader(boolean ignoreEncodingErrors) throws IOExceptio * @throws IOException if an IO error occurs. */ @Override - @WillNotClose public BufferedWriter openWriter() throws IOException { var outputStream = openUnbufferedOutputStream(); var encoder = CHARSET @@ -395,12 +386,10 @@ public String toString() { .toString(); } - @WillNotClose private InputStream openUnbufferedInputStream() throws IOException { return Files.newInputStream(fullPath); } - @WillNotClose private OutputStream openUnbufferedOutputStream() throws IOException { // Ensure parent directories exist first. Files.createDirectories(fullPath.getParent()); @@ -418,7 +407,6 @@ private CharsetDecoder decoder(boolean ignoreEncodingErrors) { .onMalformedInput(action); } - @Nullable private T unknown() { return null; } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerAnnotationProcessorClassPathConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerAnnotationProcessorClassPathConfigurer.java index 82b4a0ce8..247c0d23c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerAnnotationProcessorClassPathConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerAnnotationProcessorClassPathConfigurer.java @@ -19,8 +19,6 @@ import io.github.ascopes.jct.filemanagers.AnnotationProcessorDiscovery; import io.github.ascopes.jct.filemanagers.JctFileManager; import java.util.Map; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -37,7 +35,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerAnnotationProcessorClassPathConfigurer implements JctFileManagerConfigurer { @@ -66,7 +63,7 @@ public JctFileManagerAnnotationProcessorClassPathConfigurer(JctCompiler co } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug("Configuring annotation processor discovery mechanism"); switch (compiler.getAnnotationProcessorDiscovery()) { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurer.java index 8abef027a..00066b366 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurer.java @@ -16,7 +16,6 @@ package io.github.ascopes.jct.filemanagers.config; import io.github.ascopes.jct.filemanagers.JctFileManager; -import javax.annotation.WillNotClose; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -36,7 +35,7 @@ public interface JctFileManagerConfigurer { * @param fileManager the file manager implementation. * @return the new file manager (this may be the same as the input file manager). */ - JctFileManager configure(@WillNotClose JctFileManager fileManager); + JctFileManager configure(JctFileManager fileManager); /** * Determine if this configurer is enabled or not. diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurerChain.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurerChain.java index 059965a97..a25332ed6 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurerChain.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerConfigurerChain.java @@ -19,7 +19,6 @@ import java.util.Deque; import java.util.LinkedList; import java.util.List; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -32,7 +31,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JctFileManagerConfigurerChain { private static final Logger LOGGER = LoggerFactory.getLogger(JctFileManagerConfigurerChain.class); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathConfigurer.java index 96ba53518..51dceb658 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathConfigurer.java @@ -19,8 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.utils.SpecialLocationUtils; import io.github.ascopes.jct.workspaces.impl.WrappingDirectoryImpl; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -36,7 +34,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerJvmClassPathConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER = LoggerFactory @@ -54,7 +51,7 @@ public JctFileManagerJvmClassPathConfigurer(JctCompiler compiler) { } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug("Configuring the class path"); SpecialLocationUtils diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathModuleConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathModuleConfigurer.java index 5db59fda1..b689480c5 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathModuleConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmClassPathModuleConfigurer.java @@ -19,8 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.utils.SpecialLocationUtils; import io.github.ascopes.jct.workspaces.impl.WrappingDirectoryImpl; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -40,7 +38,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerJvmClassPathModuleConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER = LoggerFactory @@ -58,7 +55,7 @@ public JctFileManagerJvmClassPathModuleConfigurer(JctCompiler compiler) { } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug( "Copying any misplaced modules that exist within the class path onto the module path" ); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmModulePathConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmModulePathConfigurer.java index b7e089fc0..89e006044 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmModulePathConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmModulePathConfigurer.java @@ -19,8 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.utils.SpecialLocationUtils; import io.github.ascopes.jct.workspaces.impl.WrappingDirectoryImpl; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -36,7 +34,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerJvmModulePathConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER = LoggerFactory @@ -55,7 +52,7 @@ public JctFileManagerJvmModulePathConfigurer(JctCompiler compiler) { @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug("Configuring module path"); SpecialLocationUtils diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmPlatformClassPathConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmPlatformClassPathConfigurer.java index 014b0fbec..509ec0a9c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmPlatformClassPathConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmPlatformClassPathConfigurer.java @@ -19,8 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.utils.SpecialLocationUtils; import io.github.ascopes.jct.workspaces.impl.WrappingDirectoryImpl; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -37,7 +35,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerJvmPlatformClassPathConfigurer implements JctFileManagerConfigurer { @@ -56,7 +53,7 @@ public JctFileManagerJvmPlatformClassPathConfigurer(JctCompiler compiler) } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug("Configuring JVM platform class path"); SpecialLocationUtils diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmSystemModulesConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmSystemModulesConfigurer.java index 951243193..a6197eb2f 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmSystemModulesConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerJvmSystemModulesConfigurer.java @@ -19,8 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.utils.SpecialLocationUtils; import io.github.ascopes.jct.workspaces.impl.WrappingDirectoryImpl; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -36,7 +34,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerJvmSystemModulesConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER = LoggerFactory @@ -54,7 +51,7 @@ public JctFileManagerJvmSystemModulesConfigurer(JctCompiler compiler) { } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug("Configuring JVM system modules path"); SpecialLocationUtils diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerLoggingProxyConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerLoggingProxyConfigurer.java index fcd42db38..ef7f6d216 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerLoggingProxyConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerLoggingProxyConfigurer.java @@ -19,7 +19,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.filemanagers.LoggingFileManagerProxy; import io.github.ascopes.jct.filemanagers.LoggingMode; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -33,7 +32,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerLoggingProxyConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER = LoggerFactory diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerRequiredLocationsConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerRequiredLocationsConfigurer.java index 4aa5f07cc..e7e4f4fb1 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerRequiredLocationsConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerRequiredLocationsConfigurer.java @@ -20,8 +20,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.workspaces.Workspace; import java.util.Set; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.StandardLocation; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -37,7 +35,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerRequiredLocationsConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER @@ -65,12 +62,12 @@ public final class JctFileManagerRequiredLocationsConfigurer implements JctFileM * * @param workspace the workspace to bind to. */ - public JctFileManagerRequiredLocationsConfigurer(@WillNotClose Workspace workspace) { + public JctFileManagerRequiredLocationsConfigurer(Workspace workspace) { this.workspace = workspace; } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { LOGGER.debug("Configuring required locations that do not yet exist"); REQUIRED_LOCATIONS diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerWorkspaceConfigurer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerWorkspaceConfigurer.java index 4b17b8330..1e64757fe 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerWorkspaceConfigurer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/JctFileManagerWorkspaceConfigurer.java @@ -17,8 +17,6 @@ import io.github.ascopes.jct.filemanagers.JctFileManager; import io.github.ascopes.jct.workspaces.Workspace; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -31,7 +29,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class JctFileManagerWorkspaceConfigurer implements JctFileManagerConfigurer { private static final Logger LOGGER @@ -44,12 +41,12 @@ public final class JctFileManagerWorkspaceConfigurer implements JctFileManagerCo * * @param workspace the workspace to wrap. */ - public JctFileManagerWorkspaceConfigurer(@WillNotClose Workspace workspace) { + public JctFileManagerWorkspaceConfigurer(Workspace workspace) { this.workspace = workspace; } @Override - public JctFileManager configure(@WillNotClose JctFileManager fileManager) { + public JctFileManager configure(JctFileManager fileManager) { var paths = workspace.getAllPaths(); LOGGER.debug("Copying user-defined paths from workspace ({})", paths); workspace.getAllPaths().forEach(fileManager::addPaths); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/package-info.java index 5e3066797..87d7c7935 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/config/package-info.java @@ -17,11 +17,9 @@ * File manager configuration rules. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.filemanagers.config; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerFactoryImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerFactoryImpl.java index db9840a68..22c478627 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerFactoryImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerFactoryImpl.java @@ -30,8 +30,6 @@ import io.github.ascopes.jct.filemanagers.config.JctFileManagerWorkspaceConfigurer; import io.github.ascopes.jct.utils.VisibleForTestingOnly; import io.github.ascopes.jct.workspaces.Workspace; -import javax.annotation.WillNotClose; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -46,7 +44,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class JctFileManagerFactoryImpl implements JctFileManagerFactory { private final JctCompiler compiler; @@ -61,8 +58,7 @@ public JctFileManagerFactoryImpl(JctCompiler compiler) { } @Override - @WillNotClose - public JctFileManager createFileManager(@WillNotClose Workspace workspace) { + public JctFileManager createFileManager(Workspace workspace) { var release = compiler.getEffectiveRelease(); var fileManager = new JctFileManagerImpl(release); return createConfigurerChain(workspace) @@ -78,7 +74,7 @@ public JctFileManager createFileManager(@WillNotClose Workspace workspace) { * @return the chain to use. */ @VisibleForTestingOnly - public JctFileManagerConfigurerChain createConfigurerChain(@WillNotClose Workspace workspace) { + public JctFileManagerConfigurerChain createConfigurerChain(Workspace workspace) { // The order here is important. Do not adjust it without testing extensively first! return new JctFileManagerConfigurerChain() .addLast(new JctFileManagerWorkspaceConfigurer(workspace)) diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerImpl.java index 3e59d1164..ddad174a8 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/JctFileManagerImpl.java @@ -34,13 +34,12 @@ import java.util.Objects; import java.util.ServiceLoader; import java.util.Set; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.FileObject; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Simple implementation of a {@link JctFileManager}. @@ -49,7 +48,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class JctFileManagerImpl implements JctFileManager { private static final int UNSUPPORTED_ARGUMENT = -1; @@ -102,7 +100,6 @@ public void flush() { repository.flush(); } - @Nullable @Override public ClassLoader getClassLoader(Location location) { // While we would normally enforce that we cannot get a classloader for a closed @@ -120,7 +117,6 @@ public String getEffectiveRelease() { return effectiveRelease; } - @Nullable @Override public FileObject getFileForInput( Location location, @@ -134,7 +130,6 @@ public FileObject getFileForInput( : group.getFileForInput(packageName, relativeName); } - @Nullable @Override public FileObject getFileForOutput( Location location, @@ -163,7 +158,6 @@ public FileObject getFileForOutput( : group.getFileForOutput(packageName, relativeName); } - @Nullable @Override public JavaFileObject getJavaFileForInput( Location location, @@ -177,7 +171,6 @@ public JavaFileObject getJavaFileForInput( : group.getJavaFileForInput(className, kind); } - @Nullable @Override public JavaFileObject getJavaFileForOutput( Location location, @@ -215,7 +208,6 @@ public ModuleLocation getLocationForModule(Location location, String moduleName) return new ModuleLocation(location, moduleName); } - @Nullable @Override public ModuleLocation getLocationForModule(Location location, JavaFileObject fo) { requireOutputOrModuleOrientedLocation(location); @@ -241,7 +233,6 @@ public ModuleLocation getLocationForModule(Location location, JavaFileObject fo) @Override - @Nullable public ModuleContainerGroup getModuleContainerGroup(Location location) { requireModuleOrientedLocation(location); return repository.getModuleContainerGroup(location); @@ -253,7 +244,6 @@ public Collection getModuleContainerGroups() { } @Override - @Nullable public OutputContainerGroup getOutputContainerGroup(Location location) { requireOutputLocation(location); return repository.getOutputContainerGroup(location); @@ -265,7 +255,6 @@ public Collection getOutputContainerGroups() { } @Override - @Nullable public PackageContainerGroup getPackageContainerGroup(Location location) { requirePackageLocation(location); return repository.getPackageContainerGroup(location); @@ -300,7 +289,6 @@ public boolean hasLocation(Location location) { return repository.hasLocation(location); } - @Nullable @Override public String inferBinaryName(Location location, JavaFileObject file) { requirePackageOrientedLocation(location); @@ -316,7 +304,6 @@ public String inferBinaryName(Location location, JavaFileObject file) { : group.inferBinaryName((PathFileObject) file); } - @Nullable @Override public String inferModuleName(Location location) { requirePackageOrientedLocation(location); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/package-info.java index fb6064b32..6b7d5e14b 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/impl/package-info.java @@ -17,11 +17,9 @@ * File manager implementation details. */ @API(since = "0.0.1", status = Status.INTERNAL) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.filemanagers.impl; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/package-info.java index 6ce2f0b16..2a76d8c13 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/filemanagers/package-info.java @@ -17,11 +17,9 @@ * Implementation details for the JSR-199 file manager API. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.filemanagers; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/AbstractCompilersProvider.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/AbstractCompilersProvider.java index 08ec0b5a0..98eaf57b9 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/AbstractCompilersProvider.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/AbstractCompilersProvider.java @@ -25,7 +25,6 @@ import java.lang.reflect.InvocationTargetException; import java.util.stream.IntStream; import java.util.stream.Stream; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.junit.jupiter.api.extension.ExtensionContext; @@ -116,7 +115,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public abstract class AbstractCompilersProvider implements ArgumentsProvider { // Values that are late-bound when configure() is called from the diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/JavacCompilersProvider.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/JavacCompilersProvider.java index 4ab0e5d24..12241a181 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/JavacCompilersProvider.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/JavacCompilersProvider.java @@ -18,7 +18,6 @@ import io.github.ascopes.jct.compilers.JctCompiler; import io.github.ascopes.jct.compilers.javac.JavacJctCompilerImpl; import io.github.ascopes.jct.utils.VisibleForTestingOnly; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.junit.jupiter.params.support.AnnotationConsumer; @@ -30,7 +29,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public final class JavacCompilersProvider extends AbstractCompilersProvider implements AnnotationConsumer { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/VersionStrategy.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/VersionStrategy.java index e75d234d0..c020dafde 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/VersionStrategy.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/VersionStrategy.java @@ -16,7 +16,6 @@ package io.github.ascopes.jct.junit; import io.github.ascopes.jct.compilers.JctCompiler; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -27,7 +26,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public enum VersionStrategy { /** @@ -85,6 +83,7 @@ public void configureCompiler(JctCompiler compiler, int version) { @FunctionalInterface private interface VersionConsumer { + void apply(JctCompiler compiler, int version); } } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/package-info.java index 3ee512761..67e52189c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/junit/package-info.java @@ -17,11 +17,9 @@ * Additional functionality to simplify writing tests with Junit. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.junit; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/LocationRepresentation.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/LocationRepresentation.java index f9443503d..fb401aa05 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/LocationRepresentation.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/LocationRepresentation.java @@ -15,12 +15,11 @@ */ package io.github.ascopes.jct.repr; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.presentation.Representation; +import org.jspecify.annotations.Nullable; /** * Representation for a {@link Location location}. @@ -29,7 +28,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class LocationRepresentation implements Representation { private static final LocationRepresentation INSTANCE diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/StackTraceRepresentation.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/StackTraceRepresentation.java index 4069ce9b4..a1cc834dc 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/StackTraceRepresentation.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/StackTraceRepresentation.java @@ -16,11 +16,10 @@ package io.github.ascopes.jct.repr; import java.util.List; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.presentation.Representation; +import org.jspecify.annotations.Nullable; /** * Representation of a {@link List list} of {@link StackTraceElement stack trace frames}. @@ -29,7 +28,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class StackTraceRepresentation implements Representation { private static final StackTraceRepresentation INSTANCE = new StackTraceRepresentation(); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticListRepresentation.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticListRepresentation.java index a9b7b4173..d8e0b8060 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticListRepresentation.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticListRepresentation.java @@ -19,12 +19,11 @@ import io.github.ascopes.jct.diagnostics.TraceDiagnostic; import java.util.Collection; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.presentation.Representation; +import org.jspecify.annotations.Nullable; /** * Representation of a collection of diagnostics. @@ -33,7 +32,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class TraceDiagnosticListRepresentation implements Representation { private static final TraceDiagnosticListRepresentation INSTANCE diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticRepresentation.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticRepresentation.java index f42bd4449..04df43206 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticRepresentation.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/TraceDiagnosticRepresentation.java @@ -23,14 +23,13 @@ import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; import java.util.Locale; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.Diagnostic; import javax.tools.FileObject; import javax.tools.JavaFileObject; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.assertj.core.presentation.Representation; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +40,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class TraceDiagnosticRepresentation implements Representation { private static final TraceDiagnosticRepresentation INSTANCE @@ -110,7 +108,6 @@ public String toStringOf(@Nullable Object object) { return builder.toString(); } - @Nullable @SuppressWarnings("ConstantConditions") private Snippet extractSnippet(Diagnostic diagnostic) { var source = diagnostic.getSource(); @@ -154,7 +151,6 @@ private Snippet extractSnippet(Diagnostic diagnostic) ); } - @Nullable private static String tryGetContents(FileObject fileObject) { // We may not always be able to read the contents of a file object correctly. This may be down // to IO exceptions occurring on the disk, or it may be due to the components under-test diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/package-info.java index 190ce8a70..12a79a395 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/repr/package-info.java @@ -17,11 +17,9 @@ * Representation facilities for AssertJ integration. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.repr; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/FileUtils.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/FileUtils.java index 2e14ab93b..6fae96aec 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/FileUtils.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/FileUtils.java @@ -28,11 +28,10 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Stream; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import javax.tools.JavaFileObject.Kind; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Utilities for handling files in the file system. @@ -41,7 +40,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class FileUtils extends UtilityClass { // Exclude any "empty" extensions. At the time of writing, this will just exclude Kind.EMPTY, diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IoExceptionUtils.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IoExceptionUtils.java index 93f97dda8..a397805cf 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IoExceptionUtils.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IoExceptionUtils.java @@ -17,7 +17,6 @@ import java.io.IOException; import java.io.UncheckedIOException; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -28,7 +27,6 @@ * @author Ashley Scopes */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class IoExceptionUtils extends UtilityClass { private IoExceptionUtils() { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IterableUtils.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IterableUtils.java index 48efd217a..60b8e442c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IterableUtils.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/IterableUtils.java @@ -22,10 +22,9 @@ import java.util.List; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Iterable and collection helper utilities. @@ -34,7 +33,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class IterableUtils extends UtilityClass { private IterableUtils() { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/Lazy.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/Lazy.java index fd4f56f93..1a7f51db9 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/Lazy.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/Lazy.java @@ -17,8 +17,6 @@ import java.util.Objects; import java.util.function.Supplier; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -40,13 +38,10 @@ */ @API(since = "0.0.1", status = Status.INTERNAL) @SuppressWarnings("ConstantConditions") -@ThreadSafe public class Lazy { private final Supplier initializer; private final Object lock; - - @Nullable private volatile T data; /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ModuleDiscoverer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ModuleDiscoverer.java index c60f60355..1ff9bfa76 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ModuleDiscoverer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ModuleDiscoverer.java @@ -23,7 +23,6 @@ import java.nio.file.Path; import java.util.Map; import java.util.function.Function; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -37,7 +36,6 @@ * @since 0.0.1 (0.0.1-M7) */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class ModuleDiscoverer extends UtilityClass { private static final Logger LOGGER = LoggerFactory.getLogger(ModuleDiscoverer.class); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/NonNullApi.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/NonNullApi.java deleted file mode 100644 index 69efc2449..000000000 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/NonNullApi.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2022 - 2023, the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.github.ascopes.jct.utils; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import javax.annotation.meta.TypeQualifierDefault; -import org.apiguardian.api.API; -import org.apiguardian.api.API.Status; - -/** - * Marker annotation for a package. - * - *

Any package annotated with this will assume all methods, parameters, and type parameters - * in this API are non-null unless explicitly specified with {@link Nullable}. - * - * @author Ashley Scopes - * @since 0.0.1 - */ -@API(since = "0.0.1", status = Status.INTERNAL) -@Documented -@Inherited -@Nonnull -@Retention(RetentionPolicy.RUNTIME) -@Target({ - ElementType.PACKAGE, - ElementType.TYPE, -}) -@TypeQualifierDefault({ - ElementType.METHOD, - ElementType.PARAMETER, - ElementType.TYPE_PARAMETER, -}) -public @interface NonNullApi { -} diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/NonNullImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/NonNullImpl.java deleted file mode 100644 index 8ae9d68bc..000000000 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/NonNullImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2022 - 2023, the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.github.ascopes.jct.utils; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import javax.annotation.meta.TypeQualifierDefault; -import org.apiguardian.api.API; -import org.apiguardian.api.API.Status; - -/** - * Marker annotation for a package. - * - *

Any package annotated with this will assume all internal implementation details - * adhere to strict null-safety semantics unless explicitly annotated with {@link Nullable}. - * - * @author Ashley Scopes - * @since 0.0.1 - */ -@API(since = "0.0.1", status = Status.INTERNAL) -@Documented -@Inherited -@Nonnull -@Retention(RetentionPolicy.RUNTIME) -@Target({ - ElementType.PACKAGE, - ElementType.TYPE, -}) -@TypeQualifierDefault({ - ElementType.FIELD, - ElementType.TYPE_USE, -}) -public @interface NonNullImpl { -} diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/SpecialLocationUtils.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/SpecialLocationUtils.java index e51969c3f..eabc81cac 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/SpecialLocationUtils.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/SpecialLocationUtils.java @@ -25,7 +25,6 @@ import java.util.List; import java.util.Set; import java.util.stream.Collectors; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -38,7 +37,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class SpecialLocationUtils extends UtilityClass { // Files we don't want to propagate by default as they may clash with the environment. diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringSlicer.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringSlicer.java index 24db5e5a8..b25da57fb 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringSlicer.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringSlicer.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.Objects; import java.util.stream.Stream; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -31,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public class StringSlicer { private final String delimiter; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringUtils.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringUtils.java index 9cba49cf6..908296b07 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringUtils.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/StringUtils.java @@ -20,7 +20,6 @@ import java.text.DecimalFormat; import java.util.List; import java.util.Objects; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -31,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class StringUtils extends UtilityClass { // Number formatting stuff diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ToStringBuilder.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ToStringBuilder.java index a8ad87b4b..e37f5aacc 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ToStringBuilder.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/ToStringBuilder.java @@ -28,10 +28,9 @@ import java.util.Objects; import java.util.UUID; import java.util.regex.Pattern; -import javax.annotation.Nullable; -import javax.annotation.concurrent.NotThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Builder of {@link Object#toString()} representations for POJO objects. @@ -40,7 +39,6 @@ * @since 0.0.1 */ @API(status = Status.INTERNAL, since = "0.0.1") -@NotThreadSafe public final class ToStringBuilder { private static final String LSQUARE = "["; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/UtilityClass.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/UtilityClass.java index 399298253..ea04926cb 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/UtilityClass.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/UtilityClass.java @@ -15,7 +15,6 @@ */ package io.github.ascopes.jct.utils; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -26,7 +25,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public abstract class UtilityClass { protected UtilityClass() { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/VisibleForTestingOnly.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/VisibleForTestingOnly.java index 6db713a37..48a943251 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/VisibleForTestingOnly.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/VisibleForTestingOnly.java @@ -25,8 +25,8 @@ import org.apiguardian.api.API.Status; /** - * Annotation that marks the annotated method or constructor as only being visible - * for testing purposes. + * Annotation that marks the annotated method or constructor as only being visible for testing + * purposes. * *

This means any API should not be using this element directly. * diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/package-info.java index 0f737e90b..4c0e390aa 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/utils/package-info.java @@ -21,9 +21,9 @@ * notice. */ @API(since = "0.0.1", status = Status.INTERNAL) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.utils; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/DirectoryBuilder.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/DirectoryBuilder.java index d490e556e..0ef60cec7 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/DirectoryBuilder.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/DirectoryBuilder.java @@ -17,7 +17,6 @@ import java.io.File; import java.nio.file.Path; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -28,7 +27,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface DirectoryBuilder { /** diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/FileBuilder.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/FileBuilder.java index 5d2eef9b0..286e5c87c 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/FileBuilder.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/FileBuilder.java @@ -20,8 +20,6 @@ import java.net.URL; import java.nio.charset.Charset; import java.nio.file.Path; -import javax.annotation.WillClose; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -32,7 +30,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface FileBuilder { /** @@ -116,5 +113,5 @@ public interface FileBuilder { * @param inputStream the input stream to read. * @return the root managed directory for further configuration. */ - ManagedDirectory fromInputStream(@WillClose InputStream inputStream); + ManagedDirectory fromInputStream(InputStream inputStream); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/ManagedDirectory.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/ManagedDirectory.java index 41621565f..16d39652e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/ManagedDirectory.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/ManagedDirectory.java @@ -17,8 +17,6 @@ import java.io.Closeable; import java.io.IOException; -import javax.annotation.CheckReturnValue; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -30,7 +28,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface ManagedDirectory extends DirectoryBuilder, PathRoot { /** @@ -40,7 +37,6 @@ public interface ManagedDirectory extends DirectoryBuilder, PathRoot { * @see #and * @see #then */ - @CheckReturnValue default ManagedDirectory also() { return this; } @@ -52,7 +48,6 @@ default ManagedDirectory also() { * @see #also * @see #then */ - @CheckReturnValue default ManagedDirectory and() { return this; } @@ -87,7 +82,6 @@ default ManagedDirectory and() { * @param rest any additional parts of the path. * @return the directory builder. */ - @CheckReturnValue DirectoryBuilder createDirectory(String first, String... rest); /** @@ -105,7 +99,6 @@ default ManagedDirectory and() { * @param fragments any additional parts of the path. * @return the file builder. */ - @CheckReturnValue FileBuilder createFile(String fragment, String... fragments); /** @@ -113,7 +106,6 @@ default ManagedDirectory and() { * * @return the identifier string. */ - @CheckReturnValue String getName(); /** @@ -123,7 +115,6 @@ default ManagedDirectory and() { * @see #and * @see #also */ - @CheckReturnValue default ManagedDirectory then() { return this; } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathRoot.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathRoot.java index b986af163..664ad0f00 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathRoot.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathRoot.java @@ -20,10 +20,9 @@ import java.net.URL; import java.nio.file.FileSystem; import java.nio.file.Path; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * A path-like object that can provide a {@link Path Java NIO Path}. @@ -41,7 +40,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public interface PathRoot { /** @@ -89,6 +87,5 @@ public interface PathRoot { * * @return the parent path root, or {@code null} if no parent root exists. */ - @Nullable PathRoot getParent(); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathStrategy.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathStrategy.java index f06be0b66..fc8e7b89b 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathStrategy.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/PathStrategy.java @@ -21,7 +21,6 @@ import java.io.File; import java.nio.file.Path; import java.util.function.Function; -import javax.annotation.concurrent.ThreadSafe; import javax.annotation.processing.Filer; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -33,7 +32,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public enum PathStrategy { /** * Use RAM-based directories for any created directories. diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspace.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspace.java index 0516ff878..bb80ebf51 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspace.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspace.java @@ -20,8 +20,6 @@ import java.nio.file.Path; import java.util.List; import java.util.Map; -import javax.annotation.CheckReturnValue; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileManager.Location; import javax.tools.StandardLocation; import org.apiguardian.api.API; @@ -38,7 +36,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@NotThreadSafe public interface Workspace extends AutoCloseable { /** @@ -300,7 +297,6 @@ default void addPatchModulePathModule(String moduleName, Path path) { * @return the test directory that was created. * @throws IllegalArgumentException if the inputs are invalid. */ - @CheckReturnValue ManagedDirectory createPackage(Location location); /** @@ -327,7 +323,6 @@ default void addPatchModulePathModule(String moduleName, Path path) { * @return the test directory that was created. * @throws IllegalArgumentException if the inputs are invalid. */ - @CheckReturnValue ManagedDirectory createModule(Location location, String moduleName); /** @@ -335,7 +330,6 @@ default void addPatchModulePathModule(String moduleName, Path path) { * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createClassOutputPackage() { return createPackage(StandardLocation.CLASS_OUTPUT); } @@ -346,7 +340,6 @@ default ManagedDirectory createClassOutputPackage() { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createClassOutputModule(String moduleName) { return createModule(StandardLocation.CLASS_OUTPUT, moduleName); } @@ -356,7 +349,6 @@ default ManagedDirectory createClassOutputModule(String moduleName) { * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createSourceOutputPackage() { return createPackage(StandardLocation.SOURCE_OUTPUT); } @@ -367,7 +359,6 @@ default ManagedDirectory createSourceOutputPackage() { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createSourceOutputModule(String moduleName) { return createModule(StandardLocation.SOURCE_OUTPUT, moduleName); } @@ -377,7 +368,6 @@ default ManagedDirectory createSourceOutputModule(String moduleName) { * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createClassPathPackage() { return createPackage(StandardLocation.CLASS_PATH); } @@ -388,7 +378,6 @@ default ManagedDirectory createClassPathPackage() { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createModulePathModule(String moduleName) { return createModule(StandardLocation.MODULE_PATH, moduleName); } @@ -398,7 +387,6 @@ default ManagedDirectory createModulePathModule(String moduleName) { * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createSourcePathPackage() { return createPackage(StandardLocation.SOURCE_PATH); } @@ -417,7 +405,6 @@ default ManagedDirectory createSourcePathPackage() { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createSourcePathModule(String moduleName) { return createModule(StandardLocation.MODULE_SOURCE_PATH, moduleName); } @@ -430,7 +417,6 @@ default ManagedDirectory createSourcePathModule(String moduleName) { * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createAnnotationProcessorPathPackage() { return createPackage(StandardLocation.ANNOTATION_PROCESSOR_PATH); } @@ -444,7 +430,6 @@ default ManagedDirectory createAnnotationProcessorPathPackage() { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createAnnotationProcessorPathModule(String moduleName) { return createModule(StandardLocation.ANNOTATION_PROCESSOR_MODULE_PATH, moduleName); } @@ -454,7 +439,6 @@ default ManagedDirectory createAnnotationProcessorPathModule(String moduleName) * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createPlatformClassPathPackage() { return createPackage(StandardLocation.PLATFORM_CLASS_PATH); } @@ -464,7 +448,6 @@ default ManagedDirectory createPlatformClassPathPackage() { * * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createNativeHeaderOutputPackage() { return createPackage(StandardLocation.NATIVE_HEADER_OUTPUT); } @@ -475,7 +458,6 @@ default ManagedDirectory createNativeHeaderOutputPackage() { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createNativeHeaderOutputModule(String moduleName) { return createModule(StandardLocation.NATIVE_HEADER_OUTPUT, moduleName); } @@ -486,7 +468,6 @@ default ManagedDirectory createNativeHeaderOutputModule(String moduleName) { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createUpgradeModulePathModule(String moduleName) { return createModule(StandardLocation.UPGRADE_MODULE_PATH, moduleName); } @@ -497,7 +478,6 @@ default ManagedDirectory createUpgradeModulePathModule(String moduleName) { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createSystemModulePathModule(String moduleName) { return createModule(StandardLocation.SYSTEM_MODULES, moduleName); } @@ -508,7 +488,6 @@ default ManagedDirectory createSystemModulePathModule(String moduleName) { * @param moduleName the module name. * @return the created test directory. */ - @CheckReturnValue default ManagedDirectory createPatchModulePathModule(String moduleName) { return createModule(StandardLocation.PATCH_MODULE_PATH, moduleName); } @@ -518,7 +497,6 @@ default ManagedDirectory createPatchModulePathModule(String moduleName) { * * @return the paths. */ - @CheckReturnValue Map> getAllPaths(); /** @@ -526,6 +504,5 @@ default ManagedDirectory createPatchModulePathModule(String moduleName) { * * @return the path strategy. */ - @CheckReturnValue PathStrategy getPathStrategy(); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspaces.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspaces.java index 44fc6ee8f..72cf27f1e 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspaces.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/Workspaces.java @@ -17,7 +17,6 @@ import io.github.ascopes.jct.utils.UtilityClass; import io.github.ascopes.jct.workspaces.impl.WorkspaceImpl; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -28,7 +27,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.STABLE) -@ThreadSafe public final class Workspaces extends UtilityClass { private Workspaces() { diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/AbstractManagedDirectory.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/AbstractManagedDirectory.java index 5ace11431..085b3f041 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/AbstractManagedDirectory.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/AbstractManagedDirectory.java @@ -27,11 +27,9 @@ import java.net.URI; import java.net.URL; import java.nio.file.Path; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * Abstract base for implementing a reusable managed wrapper around a directory of some sort. @@ -43,7 +41,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public abstract class AbstractManagedDirectory implements ManagedDirectory { private final String name; @@ -69,44 +66,36 @@ protected AbstractManagedDirectory(String name, Path rootDirectory) { * * @return {@code null} in all cases. This implementation cannot have a parent path. */ - @CheckReturnValue - @Nullable @Override public PathRoot getParent() { return null; } - @CheckReturnValue @Override public Path getPath() { return rootDirectory; } - @CheckReturnValue @Override public URI getUri() { return uri; } - @CheckReturnValue @Override public URL getUrl() { return url; } - @CheckReturnValue @Override public String getName() { return name; } - @CheckReturnValue @Override public FileBuilder createFile(String fragment, String... fragments) { return new FileBuilderImpl(this, fragment, fragments); } - @CheckReturnValue @Override public DirectoryBuilder createDirectory(String first, String... rest) { return new DirectoryBuilderImpl(this, first, rest); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/DirectoryBuilderImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/DirectoryBuilderImpl.java index 83fa62502..c96a7df95 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/DirectoryBuilderImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/DirectoryBuilderImpl.java @@ -27,7 +27,6 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.StringJoiner; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -40,7 +39,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class DirectoryBuilderImpl implements DirectoryBuilder { private static final Logger LOGGER = LoggerFactory.getLogger(DirectoryBuilderImpl.class); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/FileBuilderImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/FileBuilderImpl.java index 78bb7af1d..56b6ed995 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/FileBuilderImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/FileBuilderImpl.java @@ -33,12 +33,9 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.Locale; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nullable; -import javax.annotation.WillClose; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +46,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class FileBuilderImpl implements FileBuilder { private static final Logger LOGGER = LoggerFactory.getLogger(FileBuilderImpl.class); @@ -135,11 +131,10 @@ public ManagedDirectory thatIsEmpty() { } @Override - public ManagedDirectory fromInputStream(@WillClose InputStream inputStream) { + public ManagedDirectory fromInputStream(InputStream inputStream) { return uncheckedIo(() -> createFile(inputStream)); } - @CheckReturnValue private ManagedDirectory createFile(InputStream input) throws IOException { Files.createDirectories(targetPath.getParent()); @@ -157,7 +152,6 @@ private ManagedDirectory createFile(InputStream input) throws IOException { } } - @CheckReturnValue private static InputStream maybeBuffer(InputStream input, @Nullable String scheme) { if (input instanceof BufferedInputStream || input instanceof ByteArrayInputStream) { return input; @@ -179,7 +173,6 @@ private static InputStream maybeBuffer(InputStream input, @Nullable String schem } } - @CheckReturnValue private static ClassLoader currentCallerClassLoader() { return Thread.currentThread().getContextClassLoader(); } diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/RamDirectoryImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/RamDirectoryImpl.java index df140d5e2..277f0b451 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/RamDirectoryImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/RamDirectoryImpl.java @@ -23,8 +23,6 @@ import java.nio.file.FileSystem; import java.nio.file.Files; import java.nio.file.Path; -import javax.annotation.CheckReturnValue; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -54,7 +52,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class RamDirectoryImpl extends AbstractManagedDirectory { private static final Logger LOGGER = LoggerFactory.getLogger(RamDirectoryImpl.class); @@ -87,7 +84,6 @@ public void close() throws IOException { * @param name a symbolic name to give the path. This must be a valid POSIX directory name. * @return the in-memory path. */ - @CheckReturnValue public static RamDirectoryImpl newRamDirectory(String name) { assertValidRootName(name); diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/TempDirectoryImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/TempDirectoryImpl.java index 9a0fcaaad..98780d077 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/TempDirectoryImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/TempDirectoryImpl.java @@ -24,8 +24,6 @@ import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; -import javax.annotation.CheckReturnValue; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; import org.slf4j.Logger; @@ -48,7 +46,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class TempDirectoryImpl extends AbstractManagedDirectory { private static final Logger LOGGER = LoggerFactory.getLogger(TempDirectoryImpl.class); @@ -92,7 +89,6 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx * environment you are using. * @return the temporary directory. */ - @CheckReturnValue @SuppressWarnings("findsecbugs:PATH_TRAVERSAL_IN") public static TempDirectoryImpl newTempDirectory(String name) { // TODO(ascopes): are MS-DOS file name length limits a potential issue here? diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WorkspaceImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WorkspaceImpl.java index 648d1e692..4f18de65f 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WorkspaceImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WorkspaceImpl.java @@ -29,7 +29,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.annotation.concurrent.NotThreadSafe; import javax.tools.JavaFileManager.Location; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; @@ -46,7 +45,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@NotThreadSafe public final class WorkspaceImpl implements Workspace { private final PathStrategy pathStrategy; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WrappingDirectoryImpl.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WrappingDirectoryImpl.java index 2fe4e52d9..e8a3e21c5 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WrappingDirectoryImpl.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/WrappingDirectoryImpl.java @@ -25,10 +25,9 @@ import java.net.URI; import java.net.URL; import java.nio.file.Path; -import javax.annotation.Nullable; -import javax.annotation.concurrent.ThreadSafe; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.Nullable; /** * A wrapper around an existing {@link Path Java NIO Path} that makes it compatible with the @@ -43,7 +42,6 @@ * @since 0.0.1 */ @API(since = "0.0.1", status = Status.INTERNAL) -@ThreadSafe public final class WrappingDirectoryImpl implements PathRoot { private final @Nullable PathRoot parent; @@ -86,7 +84,6 @@ private WrappingDirectoryImpl(@Nullable PathRoot parent, Path path) { url = retrieveRequiredUrl(this.path); } - @Nullable @Override public PathRoot getParent() { return parent; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/package-info.java index c12605f64..f9b915752 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/package-info.java @@ -17,11 +17,9 @@ * Internal workspace implementation details. */ @API(since = "0.0.1", status = Status.INTERNAL) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.workspaces.impl; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/package-info.java b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/package-info.java index fcefbd27b..49f547160 100644 --- a/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/package-info.java +++ b/java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/package-info.java @@ -17,11 +17,9 @@ * Workspace components to hold complex source code structures within memory. */ @API(since = "0.0.1", status = Status.STABLE) -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.workspaces; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; import org.apiguardian.api.API; import org.apiguardian.api.API.Status; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/main/java/module-info.java b/java-compiler-testing/src/main/java/module-info.java index 1e8dee47b..b70cdd32e 100644 --- a/java-compiler-testing/src/main/java/module-info.java +++ b/java-compiler-testing/src/main/java/module-info.java @@ -97,10 +97,10 @@ requires java.compiler; requires java.management; requires jimfs; - requires static jsr305; requires me.xdrop.fuzzywuzzy; requires static transitive org.apiguardian.api; requires org.assertj.core; + requires static org.jspecify; requires static transitive org.junit.jupiter.params; requires org.slf4j; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/integration/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/integration/package-info.java index 9db4c9314..db2ab9a69 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/integration/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/integration/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.integration; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractContainerGroupAssertTest.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractContainerGroupAssertTest.java index 9c8cdd568..8cb85ab94 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractContainerGroupAssertTest.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractContainerGroupAssertTest.java @@ -30,8 +30,8 @@ import io.github.ascopes.jct.containers.ContainerGroup; import java.util.List; import java.util.ServiceLoader; -import javax.annotation.Nullable; import org.assertj.core.api.AbstractListAssert; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractEnumAssertTest.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractEnumAssertTest.java index 7f411e380..9acb0edf9 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractEnumAssertTest.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractEnumAssertTest.java @@ -20,7 +20,7 @@ import io.github.ascopes.jct.assertions.AbstractEnumAssert; import java.util.Arrays; import java.util.List; -import javax.annotation.Nullable; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractJavaFileObjectAssertTest.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractJavaFileObjectAssertTest.java index 78bdaa916..9f72891a8 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractJavaFileObjectAssertTest.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/AbstractJavaFileObjectAssertTest.java @@ -31,13 +31,13 @@ import java.nio.charset.CharsetDecoder; import java.nio.charset.StandardCharsets; import java.time.Instant; -import javax.annotation.Nullable; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; import org.assertj.core.api.AbstractByteArrayAssert; import org.assertj.core.api.AbstractInstantAssert; import org.assertj.core.api.AbstractStringAssert; import org.assertj.core.api.AbstractUriAssert; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/package-info.java index 5bbecab2f..906b2235a 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/assertions/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.assertions; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/AbstractJctCompilerTest.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/AbstractJctCompilerTest.java index d8cca187d..d88a63135 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/AbstractJctCompilerTest.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/AbstractJctCompilerTest.java @@ -63,10 +63,10 @@ import java.util.Locale; import java.util.function.BiConsumer; import java.util.stream.Stream; -import javax.annotation.Nullable; import javax.annotation.processing.Processor; import javax.tools.JavaCompiler; import org.assertj.core.api.AbstractObjectAssert; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.ClassOrderer; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/impl/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/impl/package-info.java index f4de093ee..2a46d1961 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/impl/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/impl/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.compilers.impl; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/javac/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/javac/package-info.java index 5d873663d..b4d3b341e 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/javac/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/javac/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.compilers.javac; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/package-info.java index 970acd4d7..38d25d125 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/compilers/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.compilers; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/diagnostics/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/diagnostics/package-info.java index 51a771bf6..3a65e379e 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/diagnostics/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/diagnostics/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.diagnostics; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/ex/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/ex/package-info.java index b82b891e7..7ef9f10f5 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/ex/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/ex/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.ex; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/LoggingFileManagerProxyTest.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/LoggingFileManagerProxyTest.java index 204f7f7ae..e7c22829e 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/LoggingFileManagerProxyTest.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/LoggingFileManagerProxyTest.java @@ -45,7 +45,7 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nullable; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/package-info.java index 52096bf4f..66aa6252f 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/filemanagers/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.filemanagers; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/junit/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/junit/package-info.java index fca56e158..7d2b809ec 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/junit/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/junit/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.junit; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/package-info.java index f1d3b1996..11a8a00e1 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/repr/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/repr/package-info.java index d7be1bbd9..b4b203258 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/repr/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/repr/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.repr; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/SpecialLocationsUtilsTest.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/SpecialLocationsUtilsTest.java index 0bc3f1eba..303a2a034 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/SpecialLocationsUtilsTest.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/SpecialLocationsUtilsTest.java @@ -38,7 +38,7 @@ import java.util.List; import java.util.UUID; import java.util.stream.Collectors; -import javax.annotation.Nullable; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledForJreRange; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/package-info.java index e82cbdd1a..d528e70de 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.utils; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/impl/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/impl/package-info.java index aae992bf8..3fafb1bc9 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/impl/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/impl/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.workspaces.impl; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/package-info.java b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/package-info.java index 4d24950e0..39e51695b 100644 --- a/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/package-info.java +++ b/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/workspaces/package-info.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -@NonNullApi -@NonNullImpl +@NullMarked package io.github.ascopes.jct.tests.unit.workspaces; -import io.github.ascopes.jct.utils.NonNullApi; -import io.github.ascopes.jct.utils.NonNullImpl; +import org.jspecify.annotations.NullMarked; diff --git a/java-compiler-testing/src/test/java/module-info.java b/java-compiler-testing/src/test/java/module-info.java index ae69fbd6e..3dc1f89d3 100644 --- a/java-compiler-testing/src/test/java/module-info.java +++ b/java-compiler-testing/src/test/java/module-info.java @@ -19,11 +19,11 @@ requires java.compiler; requires java.management; requires jimfs; - requires static jsr305; requires net.bytebuddy; // required for mockito to work with JPMS. requires net.bytebuddy.agent; // required for mockito to work with JPMS. requires org.assertj.core; requires org.hamcrest; + requires static org.jspecify; requires transitive org.junit.jupiter.api; requires transitive org.junit.jupiter.engine; requires transitive org.junit.jupiter.params; diff --git a/pom.xml b/pom.xml index cc3b5d64f..36e0639e3 100644 --- a/pom.xml +++ b/pom.xml @@ -100,7 +100,7 @@ 1.4.0 4.0.8 1.2 - 3.0.2 + 0.3.0 5.9.2 5.1.1 2.0.6 @@ -168,12 +168,6 @@ - - com.google.code.findbugs - jsr305 - ${jsr305.version} - - com.google.jimfs @@ -216,6 +210,12 @@ ${groovy.version} + + org.jspecify + jspecify + ${jspecify.version} + + org.junit @@ -410,8 +410,8 @@ true https://docs.oracle.com/en/java/javase/17/docs/api - https://javadoc.io/doc/com.google.code.findbugs/jsr305/${jsr305.version} https://javadoc.io/doc/org.assertj/assertj-core/${assertj.version} + https://javadoc.io/doc/org.jspecify/jspecify/${jspecify.version} https://www.slf4j.org/apidocs https://junit.org/junit5/docs/${junit.version}/api