diff options
-rw-r--r-- | src/core/lombok/core/handlers/HandlerUtil.java | 105 |
1 files changed, 91 insertions, 14 deletions
diff --git a/src/core/lombok/core/handlers/HandlerUtil.java b/src/core/lombok/core/handlers/HandlerUtil.java index 19cc5a9e..33f2c00f 100644 --- a/src/core/lombok/core/handlers/HandlerUtil.java +++ b/src/core/lombok/core/handlers/HandlerUtil.java @@ -81,14 +81,21 @@ public class HandlerUtil { public static final List<String> NONNULL_ANNOTATIONS, BASE_COPYABLE_ANNOTATIONS, COPY_TO_SETTER_ANNOTATIONS, COPY_TO_BUILDER_SINGULAR_SETTER_ANNOTATIONS, JACKSON_COPY_TO_BUILDER_ANNOTATIONS; static { NONNULL_ANNOTATIONS = Collections.unmodifiableList(Arrays.asList(new String[] { - "androidx.annotation.NonNull", + "android.annotation.NonNull", "android.support.annotation.NonNull", + "androidx.annotation.NonNull", + "androidx.annotation.RecentlyNonNull", "com.sun.istack.internal.NotNull", "edu.umd.cs.findbugs.annotations.NonNull", + "io.reactivex.annotations.NonNull", + "io.reactivex.rxjava3.annotations.NonNull", "javax.annotation.Nonnull", // "javax.validation.constraints.NotNull", // The field might contain a null value until it is persisted. "lombok.NonNull", "org.checkerframework.checker.nullness.qual.NonNull", + "org.checkerframework.checker.nullness.compatqual.NonNullDecl", + "org.checkerframework.checker.nullness.compatqual.NonNullType", + "org.codehaus.commons.nullanalysis.NotNull", "org.eclipse.jdt.annotation.NonNull", "org.eclipse.jgit.annotations.NonNull", "org.jetbrains.annotations.NotNull", @@ -97,22 +104,64 @@ public class HandlerUtil { "org.springframework.lang.NonNull", })); BASE_COPYABLE_ANNOTATIONS = Collections.unmodifiableList(Arrays.asList(new String[] { - "androidx.annotation.NonNull", - "androidx.annotation.Nullable", + "android.annotation.NonNull", + "android.annotation.Nullable", "android.support.annotation.NonNull", "android.support.annotation.Nullable", + "androidx.annotation.NonNull", + "androidx.annotation.Nullable", + "androidx.annotation.RecentlyNonNull", + "androidx.annotation.RecentlyNullable", + "com.sun.istack.internal.NotNull", + "com.sun.istack.internal.Nullable", + "edu.umd.cs.findbugs.annotations.CheckForNull", "edu.umd.cs.findbugs.annotations.NonNull", "edu.umd.cs.findbugs.annotations.Nullable", + "edu.umd.cs.findbugs.annotations.PossiblyNull", "edu.umd.cs.findbugs.annotations.UnknownNullness", + "io.reactivex.annotations.NonNull", + "io.reactivex.annotations.Nullable", + "io.reactivex.rxjava3.annotations.NonNull", + "io.reactivex.rxjava3.annotations.Nullable", "javax.annotation.CheckForNull", "javax.annotation.Nonnull", + "javax.annotation.Nonnull", "javax.annotation.Nullable", "lombok.NonNull", + "org.checkerframework.checker.nullness.compatqual.NonNullDecl", + "org.checkerframework.checker.nullness.compatqual.NonNullType", + "org.checkerframework.checker.nullness.compatqual.NullableDecl", + "org.checkerframework.checker.nullness.compatqual.NullableType", + "org.checkerframework.checker.nullness.qual.NonNull" + "org.checkerframework.checker.nullness.qual.Nullable" + "org.codehaus.commons.nullanalysis.NotNull", + "org.codehaus.commons.nullanalysis.Nullable", + "org.eclipse.jdt.annotation.NonNull", + "org.eclipse.jdt.annotation.Nullable", + "org.eclipse.jgit.annotations.NonNull", + "org.eclipse.jgit.annotations.Nullable", + "org.jetbrains.annotations.NotNull", + "org.jetbrains.annotations.Nullable", "org.jmlspecs.annotation.NonNull", "org.jmlspecs.annotation.Nullable", + "org.jspecify.nullness.Nullable", + "org.jspecify.nullness.NullnessUnspecified", + "org.netbeans.api.annotations.common.CheckForNull", + "org.netbeans.api.annotations.common.NonNull", + "org.netbeans.api.annotations.common.NullAllowed", + "org.netbeans.api.annotations.common.NullUnknown", + "org.springframework.lang.NonNull", + "org.springframework.lang.Nullable", + + // Checker Framework annotations. // To update Checker Framework annotations, run: - // grep --recursive --files-with-matches -e '^@Target\b.*TYPE_USE' $CHECKERFRAMEWORK/checker/src/main/java $CHECKERFRAMEWORK/framework/src/main/java | grep '\.java$' | sed 's/.*\/java\//\t\t\t"/' | sed 's/\.java$/",/' | sed 's/\//./g' | sort + // grep --recursive --files-with-matches -e '^@Target\b.*TYPE_USE' $CHECKERFRAMEWORK/checker/src/main/java $CHECKERFRAMEWORK/checker-qual/src/main/java $CHECKERFRAMEWORK/checker-util/src/main/java $CHECKERFRAMEWORK/framework/src/main/java | grep '\.java$' | sed 's/.*\/java\//\t\t\t"/' | sed 's/\.java$/",/' | sed 's/\//./g' | sort // Only add new annotations, do not remove annotations that have been removed from the lastest version of the Checker Framework. + "org.checkerframework.checker.builder.qual.CalledMethods", + "org.checkerframework.checker.builder.qual.NotCalledMethods", + "org.checkerframework.checker.calledmethods.qual.CalledMethods", + "org.checkerframework.checker.calledmethods.qual.CalledMethodsBottom", + "org.checkerframework.checker.calledmethods.qual.CalledMethodsPredicate", "org.checkerframework.checker.compilermsgs.qual.CompilerMessageKey", "org.checkerframework.checker.compilermsgs.qual.CompilerMessageKeyBottom", "org.checkerframework.checker.compilermsgs.qual.UnknownCompilerMessageKey", @@ -136,6 +185,7 @@ public class HandlerUtil { "org.checkerframework.checker.formatter.qual.Format", "org.checkerframework.checker.formatter.qual.FormatBottom", "org.checkerframework.checker.formatter.qual.InvalidFormat", + "org.checkerframework.checker.formatter.qual.UnknownFormat", "org.checkerframework.checker.guieffect.qual.AlwaysSafe", "org.checkerframework.checker.guieffect.qual.PolyUI", "org.checkerframework.checker.guieffect.qual.UI", @@ -180,6 +230,7 @@ public class HandlerUtil { "org.checkerframework.checker.index.qual.SubstringIndexFor", "org.checkerframework.checker.index.qual.SubstringIndexUnknown", "org.checkerframework.checker.index.qual.UpperBoundBottom", + "org.checkerframework.checker.index.qual.UpperBoundLiteral", "org.checkerframework.checker.index.qual.UpperBoundUnknown", "org.checkerframework.checker.initialization.qual.FBCBottom", "org.checkerframework.checker.initialization.qual.Initialized", @@ -193,6 +244,11 @@ public class HandlerUtil { "org.checkerframework.checker.lock.qual.GuardedByBottom", "org.checkerframework.checker.lock.qual.GuardedByUnknown", "org.checkerframework.checker.lock.qual.GuardSatisfied", + "org.checkerframework.checker.lock.qual.NewObject", + "org.checkerframework.checker.mustcall.qual.MustCall", + "org.checkerframework.checker.mustcall.qual.MustCallAlias", + "org.checkerframework.checker.mustcall.qual.MustCallUnknown", + "org.checkerframework.checker.mustcall.qual.PolyMustCall", "org.checkerframework.checker.nullness.qual.KeyFor", "org.checkerframework.checker.nullness.qual.KeyForBottom", "org.checkerframework.checker.nullness.qual.MonotonicNonNull", @@ -205,6 +261,7 @@ public class HandlerUtil { "org.checkerframework.checker.nullness.qual.Raw", "org.checkerframework.checker.nullness.qual.UnknownKeyFor", "org.checkerframework.checker.optional.qual.MaybePresent", + "org.checkerframework.checker.optional.qual.OptionalBottom", "org.checkerframework.checker.optional.qual.PolyPresent", "org.checkerframework.checker.optional.qual.Present", "org.checkerframework.checker.propkey.qual.PropertyKey", @@ -214,29 +271,41 @@ public class HandlerUtil { "org.checkerframework.checker.regex.qual.Regex", "org.checkerframework.checker.regex.qual.RegexBottom", "org.checkerframework.checker.regex.qual.UnknownRegex", + "org.checkerframework.checker.signature.qual.ArrayWithoutPackage", "org.checkerframework.checker.signature.qual.BinaryName", "org.checkerframework.checker.signature.qual.BinaryNameInUnnamedPackage", + "org.checkerframework.checker.signature.qual.BinaryNameOrPrimitiveType", + "org.checkerframework.checker.signature.qual.BinaryNameWithoutPackage", + "org.checkerframework.checker.signature.qual.CanonicalName", + "org.checkerframework.checker.signature.qual.CanonicalNameAndBinaryName", + "org.checkerframework.checker.signature.qual.CanonicalNameOrEmpty", + "org.checkerframework.checker.signature.qual.CanonicalNameOrPrimitiveType", "org.checkerframework.checker.signature.qual.ClassGetName", "org.checkerframework.checker.signature.qual.ClassGetSimpleName", "org.checkerframework.checker.signature.qual.DotSeparatedIdentifiers", + "org.checkerframework.checker.signature.qual.DotSeparatedIdentifiersOrPrimitiveType", "org.checkerframework.checker.signature.qual.FieldDescriptor", "org.checkerframework.checker.signature.qual.FieldDescriptorForPrimitive", "org.checkerframework.checker.signature.qual.FieldDescriptorForPrimitiveOrArrayInUnnamedPackage", + "org.checkerframework.checker.signature.qual.FieldDescriptorWithoutPackage", "org.checkerframework.checker.signature.qual.FqBinaryName", "org.checkerframework.checker.signature.qual.FullyQualifiedName", "org.checkerframework.checker.signature.qual.Identifier", "org.checkerframework.checker.signature.qual.IdentifierOrArray", + "org.checkerframework.checker.signature.qual.IdentifierOrPrimitiveType", "org.checkerframework.checker.signature.qual.InternalForm", "org.checkerframework.checker.signature.qual.MethodDescriptor", "org.checkerframework.checker.signature.qual.PolySignature", + "org.checkerframework.checker.signature.qual.PrimitiveType", "org.checkerframework.checker.signature.qual.SignatureBottom", "org.checkerframework.checker.signedness.qual.Constant", - "org.checkerframework.checker.signedness.qual.PolySignedness", "org.checkerframework.checker.signedness.qual.PolySigned", + "org.checkerframework.checker.signedness.qual.PolySignedness", "org.checkerframework.checker.signedness.qual.Signed", "org.checkerframework.checker.signedness.qual.SignednessBottom", "org.checkerframework.checker.signedness.qual.SignednessGlb", "org.checkerframework.checker.signedness.qual.SignedPositive", + "org.checkerframework.checker.signedness.qual.SignedPositiveFromUnsigned", "org.checkerframework.checker.signedness.qual.UnknownSignedness", "org.checkerframework.checker.signedness.qual.Unsigned", "org.checkerframework.checker.tainting.qual.PolyTainted", @@ -250,37 +319,48 @@ public class HandlerUtil { "org.checkerframework.checker.units.qual.cd", "org.checkerframework.checker.units.qual.Current", "org.checkerframework.checker.units.qual.degrees", + "org.checkerframework.checker.units.qual.Force", "org.checkerframework.checker.units.qual.g", "org.checkerframework.checker.units.qual.h", "org.checkerframework.checker.units.qual.K", "org.checkerframework.checker.units.qual.kg", "org.checkerframework.checker.units.qual.km", "org.checkerframework.checker.units.qual.km2", + "org.checkerframework.checker.units.qual.km3", "org.checkerframework.checker.units.qual.kmPERh", + "org.checkerframework.checker.units.qual.kN", "org.checkerframework.checker.units.qual.Length", "org.checkerframework.checker.units.qual.Luminance", "org.checkerframework.checker.units.qual.m", "org.checkerframework.checker.units.qual.m2", + "org.checkerframework.checker.units.qual.m3", "org.checkerframework.checker.units.qual.Mass", "org.checkerframework.checker.units.qual.min", "org.checkerframework.checker.units.qual.mm", "org.checkerframework.checker.units.qual.mm2", + "org.checkerframework.checker.units.qual.mm3", "org.checkerframework.checker.units.qual.mol", "org.checkerframework.checker.units.qual.mPERs", "org.checkerframework.checker.units.qual.mPERs2", + "org.checkerframework.checker.units.qual.N", "org.checkerframework.checker.units.qual.PolyUnit", "org.checkerframework.checker.units.qual.radians", "org.checkerframework.checker.units.qual.s", "org.checkerframework.checker.units.qual.Speed", "org.checkerframework.checker.units.qual.Substance", + "org.checkerframework.checker.units.qual.t", "org.checkerframework.checker.units.qual.Temperature", "org.checkerframework.checker.units.qual.Time", "org.checkerframework.checker.units.qual.UnitsBottom", "org.checkerframework.checker.units.qual.UnknownUnits", + "org.checkerframework.checker.units.qual.Volume", "org.checkerframework.common.aliasing.qual.LeakedToResult", "org.checkerframework.common.aliasing.qual.MaybeAliased", "org.checkerframework.common.aliasing.qual.NonLeaked", "org.checkerframework.common.aliasing.qual.Unique", + "org.checkerframework.common.initializedfields.qual.InitializedFields", + "org.checkerframework.common.initializedfields.qual.InitializedFieldsBottom", + "org.checkerframework.common.initializedfields.qual.PolyInitializedFields", "org.checkerframework.common.reflection.qual.ClassBound", "org.checkerframework.common.reflection.qual.ClassVal", "org.checkerframework.common.reflection.qual.ClassValBottom", @@ -288,6 +368,9 @@ public class HandlerUtil { "org.checkerframework.common.reflection.qual.MethodValBottom", "org.checkerframework.common.reflection.qual.UnknownClass", "org.checkerframework.common.reflection.qual.UnknownMethod", + "org.checkerframework.common.returnsreceiver.qual.BottomThis", + "org.checkerframework.common.returnsreceiver.qual.This", + "org.checkerframework.common.returnsreceiver.qual.UnknownThis", "org.checkerframework.common.subtyping.qual.Bottom", "org.checkerframework.common.util.report.qual.ReportUnqualified", "org.checkerframework.common.value.qual.ArrayLen", @@ -295,23 +378,17 @@ public class HandlerUtil { "org.checkerframework.common.value.qual.BoolVal", "org.checkerframework.common.value.qual.BottomVal", "org.checkerframework.common.value.qual.DoubleVal", + "org.checkerframework.common.value.qual.EnumVal", "org.checkerframework.common.value.qual.IntRange", "org.checkerframework.common.value.qual.IntVal", + "org.checkerframework.common.value.qual.MatchesRegex", "org.checkerframework.common.value.qual.MinLen", "org.checkerframework.common.value.qual.PolyValue", "org.checkerframework.common.value.qual.StringVal", "org.checkerframework.common.value.qual.UnknownVal", "org.checkerframework.framework.qual.PolyAll", + "org.checkerframework.framework.qual.PurityUnqualified", "org.checkerframework.framework.util.PurityUnqualified", - - "org.eclipse.jdt.annotation.NonNull", - "org.eclipse.jdt.annotation.Nullable", - "org.jetbrains.annotations.NotNull", - "org.jetbrains.annotations.Nullable", - "org.springframework.lang.NonNull", - "org.springframework.lang.Nullable", - "org.netbeans.api.annotations.common.NonNull", - "org.netbeans.api.annotations.common.NullAllowed", })); COPY_TO_SETTER_ANNOTATIONS = Collections.unmodifiableList(Arrays.asList(new String[] { "com.fasterxml.jackson.annotation.JacksonInject", |