diff --git a/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java b/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java index 9f9f0e68ccf..e120e99cc8a 100644 --- a/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java +++ b/byte-buddy-agent/src/main/java/net/bytebuddy/agent/VirtualMachine.java @@ -24,8 +24,6 @@ import net.bytebuddy.agent.nullability.MaybeNull; import net.bytebuddy.agent.nullability.UnknownNull; -import javax.annotation.Nonnull; -import javax.annotation.meta.When; import java.io.*; import java.net.ServerSocket; import java.net.Socket; diff --git a/byte-buddy-android/src/main/java/net/bytebuddy/android/package-info.java b/byte-buddy-android/src/main/java/net/bytebuddy/android/package-info.java index 65fb062088f..295396cbd95 100644 --- a/byte-buddy-android/src/main/java/net/bytebuddy/android/package-info.java +++ b/byte-buddy-android/src/main/java/net/bytebuddy/android/package-info.java @@ -16,7 +16,7 @@ /** * This package is dedicated to supporting Byte Buddy on Android devices. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.android; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByExtensionBenchmark.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByExtensionBenchmark.java index 0ae2bd665fb..b83611f2d58 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByExtensionBenchmark.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByExtensionBenchmark.java @@ -28,6 +28,7 @@ import net.bytebuddy.implementation.SuperMethodCall; import net.bytebuddy.implementation.bind.annotation.*; import net.bytebuddy.pool.TypePool; +import net.bytebuddy.utility.nullability.MaybeNull; import net.sf.cglib.proxy.*; import org.openjdk.jmh.annotations.*; diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByImplementationBenchmark.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByImplementationBenchmark.java index a4aac6aefd2..fefb1ac73ea 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByImplementationBenchmark.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/ClassByImplementationBenchmark.java @@ -25,6 +25,8 @@ import net.bytebuddy.dynamic.scaffold.TypeValidation; import net.bytebuddy.implementation.StubMethod; import net.bytebuddy.pool.TypePool; +import net.bytebuddy.utility.nullability.AlwaysNull; +import net.bytebuddy.utility.nullability.MaybeNull; import net.sf.cglib.proxy.CallbackHelper; import net.sf.cglib.proxy.Enhancer; import net.sf.cglib.proxy.FixedValue; @@ -257,7 +259,7 @@ public double method(double arg) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public Object method(Object arg) { return null; } @@ -265,7 +267,7 @@ public Object method(Object arg) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public boolean[] method(boolean arg1, boolean arg2, boolean arg3) { return null; } @@ -273,7 +275,7 @@ public boolean[] method(boolean arg1, boolean arg2, boolean arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public byte[] method(byte arg1, byte arg2, byte arg3) { return null; } @@ -281,7 +283,7 @@ public byte[] method(byte arg1, byte arg2, byte arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public short[] method(short arg1, short arg2, short arg3) { return null; } @@ -289,7 +291,7 @@ public short[] method(short arg1, short arg2, short arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public int[] method(int arg1, int arg2, int arg3) { return null; } @@ -297,7 +299,7 @@ public int[] method(int arg1, int arg2, int arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public char[] method(char arg1, char arg2, char arg3) { return null; } @@ -305,7 +307,7 @@ public char[] method(char arg1, char arg2, char arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public long[] method(long arg1, long arg2, long arg3) { return null; } @@ -313,7 +315,7 @@ public long[] method(long arg1, long arg2, long arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public float[] method(float arg1, float arg2, float arg3) { return null; } @@ -321,7 +323,7 @@ public float[] method(float arg1, float arg2, float arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public double[] method(double arg1, double arg2, double arg3) { return null; } @@ -329,7 +331,7 @@ public double[] method(double arg1, double arg2, double arg3) { /** * {@inheritDoc} */ - @MaybeNull + @AlwaysNull public Object[] method(Object arg1, Object arg2, Object arg3) { return null; } diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/StubInvocationBenchmark.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/StubInvocationBenchmark.java index 2128cc7f018..4f4d9717bbc 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/StubInvocationBenchmark.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/StubInvocationBenchmark.java @@ -16,6 +16,7 @@ package net.bytebuddy.benchmark; import net.bytebuddy.benchmark.specimen.ExampleInterface; +import net.bytebuddy.utility.nullability.MaybeNull; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/SuperClassInvocationBenchmark.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/SuperClassInvocationBenchmark.java index e9087dc4e53..0e7289f2eea 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/SuperClassInvocationBenchmark.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/SuperClassInvocationBenchmark.java @@ -16,6 +16,7 @@ package net.bytebuddy.benchmark; import net.bytebuddy.benchmark.specimen.ExampleClass; +import net.bytebuddy.utility.nullability.MaybeNull; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/package-info.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/package-info.java index c0780120feb..1a34fb0cbf5 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/package-info.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/package-info.java @@ -16,7 +16,7 @@ /** * A package containing benchmarks for Byte Buddy and other code generation libraries. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.benchmark; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/runner/package-info.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/runner/package-info.java index e869fd9dedd..d13a6ac3918 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/runner/package-info.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/runner/package-info.java @@ -16,7 +16,7 @@ /** * A package dedicated to running benchmarks. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.benchmark.runner; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/ExampleInterface.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/ExampleInterface.java index 6f8ca667fbf..85f45fdedb5 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/ExampleInterface.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/ExampleInterface.java @@ -15,6 +15,8 @@ */ package net.bytebuddy.benchmark.specimen; +import net.bytebuddy.utility.nullability.MaybeNull; + /** * An example interface with several methods which is used as a specimen in benchmarks. */ diff --git a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/package-info.java b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/package-info.java index 64e4eba7e70..9e373c209a3 100644 --- a/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/package-info.java +++ b/byte-buddy-benchmark/src/main/java/net/bytebuddy/benchmark/specimen/package-info.java @@ -16,7 +16,7 @@ /** * Specimen classes which are required for some benchmarks. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.benchmark.specimen; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java b/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java index 9091f7c8db9..6487cf9e205 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/AgentBuilder.java @@ -67,10 +67,10 @@ import net.bytebuddy.utility.JavaModule; import net.bytebuddy.utility.JavaType; import net.bytebuddy.utility.dispatcher.JavaDispatcher; +import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.*; -import javax.annotation.CheckForNull; import java.io.*; import java.lang.instrument.*; import java.lang.ref.WeakReference; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/package-info.java b/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/package-info.java index 176a558ee84..836accab27c 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/package-info.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/agent/builder/package-info.java @@ -19,7 +19,7 @@ * but offers higher-level APIs in order to allow for the implementation of very readable transformations using * {@link net.bytebuddy.ByteBuddy}. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.agent.builder; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/asm/AsmVisitorWrapper.java b/byte-buddy-dep/src/main/java/net/bytebuddy/asm/AsmVisitorWrapper.java index 667df1ba965..e35d27c7918 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/asm/AsmVisitorWrapper.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/asm/AsmVisitorWrapper.java @@ -31,7 +31,6 @@ import org.objectweb.asm.FieldVisitor; import org.objectweb.asm.MethodVisitor; -import javax.annotation.CheckForNull; import java.util.*; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/asm/MemberSubstitution.java b/byte-buddy-dep/src/main/java/net/bytebuddy/asm/MemberSubstitution.java index 46c4416c4de..d3af373242d 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/asm/MemberSubstitution.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/asm/MemberSubstitution.java @@ -43,6 +43,7 @@ import net.bytebuddy.pool.TypePool; import net.bytebuddy.utility.CompoundList; import net.bytebuddy.utility.OpenedClassReader; +import net.bytebuddy.utility.nullability.MaybeNull; import net.bytebuddy.utility.visitor.LocalVariableAwareMethodVisitor; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/build/HashCodeAndEqualsPlugin.java b/byte-buddy-dep/src/main/java/net/bytebuddy/build/HashCodeAndEqualsPlugin.java index 8abf69e812b..d205a53bd9a 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/build/HashCodeAndEqualsPlugin.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/build/HashCodeAndEqualsPlugin.java @@ -30,10 +30,10 @@ import net.bytebuddy.implementation.attribute.MethodAttributeAppender; import net.bytebuddy.matcher.ElementMatcher; import net.bytebuddy.matcher.ElementMatchers; +import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.MethodVisitor; -import javax.annotation.CheckForNull; import java.lang.annotation.*; import java.util.Comparator; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java b/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java index 39c7b09bf35..c12e1ecbfe6 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java @@ -31,7 +31,6 @@ import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.io.*; import java.lang.annotation.*; import java.lang.reflect.Constructor; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/build/ToStringPlugin.java b/byte-buddy-dep/src/main/java/net/bytebuddy/build/ToStringPlugin.java index 6fd5d2e231e..1efaf3d09da 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/build/ToStringPlugin.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/build/ToStringPlugin.java @@ -24,8 +24,8 @@ import net.bytebuddy.dynamic.DynamicType; import net.bytebuddy.implementation.ToStringMethod; import net.bytebuddy.matcher.ElementMatchers; +import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.lang.annotation.*; import static net.bytebuddy.matcher.ElementMatchers.*; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/TypeVariableSource.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/TypeVariableSource.java index 9626250c3b2..7cbc255f5e3 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/TypeVariableSource.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/TypeVariableSource.java @@ -18,6 +18,8 @@ import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.description.type.TypeList; +import net.bytebuddy.utility.nullability.AlwaysNull; +import net.bytebuddy.utility.nullability.MaybeNull; import static net.bytebuddy.matcher.ElementMatchers.named; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationDescription.java index 056bb53710b..2385df02396 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationDescription.java @@ -30,7 +30,6 @@ import net.bytebuddy.utility.nullability.MaybeNull; import net.bytebuddy.utility.privilege.SetAccessibleAction; -import javax.annotation.CheckForNull; import java.lang.annotation.*; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationValue.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationValue.java index 64af712ac45..468cad145a0 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationValue.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/annotation/AnnotationValue.java @@ -25,7 +25,6 @@ import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.lang.annotation.Annotation; import java.lang.annotation.AnnotationTypeMismatchException; import java.lang.annotation.IncompleteAnnotationException; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/enumeration/EnumerationDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/enumeration/EnumerationDescription.java index 618cbb60bc9..dcc996c2ddd 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/enumeration/EnumerationDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/enumeration/EnumerationDescription.java @@ -18,8 +18,8 @@ import net.bytebuddy.build.CachedReturnPlugin; import net.bytebuddy.description.NamedElement; import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.util.ArrayList; import java.util.List; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/field/FieldDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/field/FieldDescription.java index 526c4891cdf..eca9b055a58 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/field/FieldDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/field/FieldDescription.java @@ -30,7 +30,6 @@ import org.objectweb.asm.Opcodes; import org.objectweb.asm.signature.SignatureWriter; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import java.lang.reflect.Field; import java.lang.reflect.GenericSignatureFormatError; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/MethodDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/MethodDescription.java index 654833fb650..d3c55837e05 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/MethodDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/MethodDescription.java @@ -39,7 +39,6 @@ import org.objectweb.asm.Type; import org.objectweb.asm.signature.SignatureWriter; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import java.lang.annotation.Annotation; import java.lang.reflect.*; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/ParameterDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/ParameterDescription.java index 5140ac4e8b1..04e2b233b4c 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/ParameterDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/method/ParameterDescription.java @@ -34,7 +34,6 @@ import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.lang.annotation.Annotation; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Constructor; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/package-info.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/package-info.java index 2e433ae15cf..c1bf7f726e0 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/package-info.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/package-info.java @@ -18,7 +18,7 @@ * reflection API, it would be required to load classes but by using these descriptions, it is possible to * represent byte code elements without prior loading. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.description; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/PackageDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/PackageDescription.java index 16a0261705a..7085453ed84 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/PackageDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/PackageDescription.java @@ -19,10 +19,9 @@ import net.bytebuddy.description.annotation.AnnotationList; import net.bytebuddy.description.annotation.AnnotationSource; import net.bytebuddy.utility.nullability.AlwaysNull; +import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.Opcodes; -import javax.annotation.CheckForNull; - /** * A package description represents a Java package. */ diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/RecordComponentDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/RecordComponentDescription.java index 153d96bec8a..0273bdc14f3 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/RecordComponentDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/RecordComponentDescription.java @@ -29,7 +29,6 @@ import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.signature.SignatureWriter; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.GenericSignatureFormatError; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDefinition.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDefinition.java index d8b48256ea2..a6eae88f13e 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDefinition.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDefinition.java @@ -25,8 +25,6 @@ import net.bytebuddy.utility.nullability.MaybeNull; import net.bytebuddy.utility.nullability.UnknownNull; -import javax.annotation.Nonnull; -import javax.annotation.meta.When; import java.lang.reflect.*; import java.security.PrivilegedAction; import java.util.Iterator; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java index 72e3e3b6509..6eddfe79552 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeDescription.java @@ -46,7 +46,6 @@ import org.objectweb.asm.signature.SignatureVisitor; import org.objectweb.asm.signature.SignatureWriter; -import javax.annotation.CheckForNull; import java.io.Serializable; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeVariableToken.java b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeVariableToken.java index 32ba68b327e..56cf3c62af6 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeVariableToken.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/description/type/TypeVariableToken.java @@ -20,8 +20,8 @@ import net.bytebuddy.description.annotation.AnnotationDescription; import net.bytebuddy.description.annotation.AnnotationList; import net.bytebuddy.matcher.ElementMatcher; +import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.util.Collections; import java.util.List; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/DynamicType.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/DynamicType.java index 86e9b58bb53..06890e7d004 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/DynamicType.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/DynamicType.java @@ -41,6 +41,7 @@ import net.bytebuddy.utility.CompoundList; import net.bytebuddy.utility.FileSystem; import net.bytebuddy.utility.GraalImageCode; +import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.Opcodes; import java.io.*; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/Nexus.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/Nexus.java index 8ebe58adbc1..08bd7ed87ec 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/Nexus.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/Nexus.java @@ -15,7 +15,9 @@ */ package net.bytebuddy.dynamic; -import javax.annotation.CheckForNull; +import net.bytebuddy.utility.nullability.AlwaysNull; +import net.bytebuddy.utility.nullability.MaybeNull; + import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java index c05af6a5c63..4f45e579240 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/ClassInjector.java @@ -39,8 +39,6 @@ import net.bytebuddy.utility.nullability.UnknownNull; import net.bytebuddy.utility.privilege.GetMethodAction; -import javax.annotation.Nonnull; -import javax.annotation.meta.When; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/PackageDefinitionStrategy.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/PackageDefinitionStrategy.java index cfccac0229c..1a5387ca3d5 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/PackageDefinitionStrategy.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/loading/PackageDefinitionStrategy.java @@ -20,7 +20,6 @@ import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodGraph.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodGraph.java index 6cc1654cca7..7655cc683f4 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodGraph.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodGraph.java @@ -27,7 +27,6 @@ import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.Opcodes; -import javax.annotation.CheckForNull; import java.util.*; import static net.bytebuddy.matcher.ElementMatchers.*; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/RecordComponentRegistry.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/RecordComponentRegistry.java index f3595a16a99..fb1a53bcf14 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/RecordComponentRegistry.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/RecordComponentRegistry.java @@ -24,7 +24,6 @@ import net.bytebuddy.matcher.LatentMatcher; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.util.*; /** diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java index 9d92f67f774..bb957c571e8 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/TypeWriter.java @@ -51,7 +51,9 @@ import net.bytebuddy.pool.TypePool; import net.bytebuddy.utility.CompoundList; import net.bytebuddy.utility.OpenedClassReader; +import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; +import net.bytebuddy.utility.nullability.UnknownNull; import net.bytebuddy.utility.privilege.GetSystemPropertyAction; import net.bytebuddy.utility.visitor.MetadataAwareClassVisitor; import org.objectweb.asm.*; @@ -59,9 +61,7 @@ import org.objectweb.asm.commons.Remapper; import org.objectweb.asm.commons.SimpleRemapper; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import javax.annotation.meta.When; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/Implementation.java b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/Implementation.java index 87b7e7825ac..2de9be3c610 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/Implementation.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/Implementation.java @@ -49,7 +49,6 @@ import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import java.util.*; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/AnnotationAppender.java b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/AnnotationAppender.java index d0289b92cba..2770b03f199 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/AnnotationAppender.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/AnnotationAppender.java @@ -22,6 +22,8 @@ import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.description.type.TypeList; +import net.bytebuddy.utility.nullability.AlwaysNull; +import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.*; import java.lang.reflect.Array; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/package-info.java b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/package-info.java index 72fbfbd91b4..124feff8de0 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/package-info.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/attribute/package-info.java @@ -18,7 +18,7 @@ * i.e. fields, types and byte code methods. A common Java attribute is a Java annotation which are represented by * the {@link java.lang.annotation.Annotation} interface. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.implementation.attribute; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/auxiliary/package-info.java b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/auxiliary/package-info.java index 458034ed57f..d1d5071906f 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/auxiliary/package-info.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/auxiliary/package-info.java @@ -18,7 +18,7 @@ * {@link net.bytebuddy.dynamic.scaffold.InstrumentedType}. A typical use case for auxiliary types is granting * access to {@code super} invocations of method calls. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.implementation.auxiliary; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/bytecode/constant/FieldConstant.java b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/bytecode/constant/FieldConstant.java index 6b4570bc04e..2ba9cc82c89 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/bytecode/constant/FieldConstant.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/bytecode/constant/FieldConstant.java @@ -25,7 +25,6 @@ import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.MethodVisitor; -import javax.annotation.CheckForNull; import java.lang.reflect.Field; /** diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/LatentMatcher.java b/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/LatentMatcher.java index aac1a01acef..3944521a71b 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/LatentMatcher.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/matcher/LatentMatcher.java @@ -22,7 +22,6 @@ import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.util.Arrays; import java.util.List; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java b/byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java index 347751e3779..984f6d1fca1 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java @@ -44,9 +44,7 @@ import org.objectweb.asm.signature.SignatureReader; import org.objectweb.asm.signature.SignatureVisitor; -import javax.annotation.CheckForNull; import javax.annotation.Nonnull; -import javax.annotation.meta.When; import java.io.IOException; import java.lang.annotation.Annotation; import java.lang.ref.SoftReference; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java b/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java index 0f80682f9da..779bf0d3725 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaConstant.java @@ -25,10 +25,10 @@ import net.bytebuddy.dynamic.ClassFileLocator; import net.bytebuddy.pool.TypePool; import net.bytebuddy.utility.dispatcher.JavaDispatcher; +import net.bytebuddy.utility.nullability.MaybeNull; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; -import javax.annotation.CheckForNull; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaModule.java b/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaModule.java index 6de3088abf7..7e07e576c4a 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaModule.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/utility/JavaModule.java @@ -25,7 +25,6 @@ import net.bytebuddy.utility.nullability.AlwaysNull; import net.bytebuddy.utility.nullability.MaybeNull; -import javax.annotation.CheckForNull; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.AnnotatedElement; diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/utility/dispatcher/package-info.java b/byte-buddy-dep/src/main/java/net/bytebuddy/utility/dispatcher/package-info.java index be65389aa32..1105add94cc 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/utility/dispatcher/package-info.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/utility/dispatcher/package-info.java @@ -19,7 +19,7 @@ * This way, external users cannot emulate Byte Buddy's privilege when caller sensitive code * would be proxied. */ -@NeverNull +@NeverNull.ByDefault package net.bytebuddy.utility.dispatcher; import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java index b3879619010..a1d04390bce 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTask.java @@ -31,7 +31,7 @@ import org.gradle.api.tasks.Optional; import org.gradle.util.ConfigureUtil; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; import java.io.*; import java.net.URL; import java.util.*; diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskConfiguration.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskConfiguration.java index def0ca4bd17..18b00320991 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskConfiguration.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskConfiguration.java @@ -24,7 +24,7 @@ import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.compile.JavaCompile; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; /** * An abstract configuration for a Byte Buddy task and extension. diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskExtension.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskExtension.java index e0af7a8483c..878e92f33c7 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskExtension.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/AbstractByteBuddyTaskExtension.java @@ -23,7 +23,7 @@ import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.util.ConfigureUtil; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; import java.util.ArrayList; import java.util.List; diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Adjustment.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Adjustment.java index 552c5c91a6b..96c90867d2c 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Adjustment.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Adjustment.java @@ -20,7 +20,7 @@ import org.gradle.api.Task; import org.gradle.api.execution.TaskExecutionGraph; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; import java.util.*; /** diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTask.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTask.java index 940444eed28..28aa885f726 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTask.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTask.java @@ -22,7 +22,7 @@ import org.gradle.api.tasks.OutputDirectory; import org.gradle.api.tasks.TaskAction; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; import javax.inject.Inject; import java.io.File; import java.io.IOException; diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTaskExtension.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTaskExtension.java index 5e716b52910..0e68f253d53 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTaskExtension.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/ByteBuddyTaskExtension.java @@ -15,7 +15,7 @@ */ package net.bytebuddy.build.gradle; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; /** * A Byte Buddy task extension. diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/PluginArgument.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/PluginArgument.java index d1bab442b05..f8323214354 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/PluginArgument.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/PluginArgument.java @@ -19,7 +19,7 @@ import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Optional; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; import java.io.Serializable; /** diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Transformation.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Transformation.java index d19a6da0f2f..5923dd13995 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Transformation.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/Transformation.java @@ -20,7 +20,7 @@ import org.gradle.api.tasks.Input; import org.gradle.util.ConfigureUtil; -import net.bytebuddy.utility.nullability.MaybeNull +import net.bytebuddy.utility.nullability.MaybeNull; import java.util.ArrayList; import java.util.List; diff --git a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/package-info.java b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/package-info.java index 576a22fa1fe..4ff20c0fb45 100644 --- a/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/package-info.java +++ b/byte-buddy-gradle-plugin/src/main/java/net/bytebuddy/build/gradle/package-info.java @@ -16,7 +16,7 @@ /** * A package containing classes for applying Byte Buddy transformers within a Gradle build. */ -@NonnullByDefault +@NeverNull.ByDefault package net.bytebuddy.build.gradle; -import net.bytebuddy.utility.NonnullByDefault; +import net.bytebuddy.utility.nullability.NeverNull; diff --git a/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/ByteBuddyMojo.java b/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/ByteBuddyMojo.java index b91fc57cefd..9b4ac823764 100644 --- a/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/ByteBuddyMojo.java +++ b/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/ByteBuddyMojo.java @@ -40,7 +40,6 @@ import org.eclipse.aether.RepositorySystemSession; import org.sonatype.plexus.build.incremental.BuildContext; -import javax.annotation.CheckForNull; import java.io.BufferedReader; import java.io.File; import java.io.IOException; diff --git a/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/MavenCoordinate.java b/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/MavenCoordinate.java index c09f77670bd..e91f93647ef 100644 --- a/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/MavenCoordinate.java +++ b/byte-buddy-maven-plugin/src/main/java/net/bytebuddy/build/maven/MavenCoordinate.java @@ -15,11 +15,10 @@ */ package net.bytebuddy.build.maven; +import net.bytebuddy.utility.nullability.MaybeNull; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; -import javax.annotation.CheckForNull; - /** * A Maven coordinate. */