diff --git a/Spigot-API-Patches/Adventure.patch b/Spigot-API-Patches/Adventure.patch index c7929797a0..b0f99f418b 100644 --- a/Spigot-API-Patches/Adventure.patch +++ b/Spigot-API-Patches/Adventure.patch @@ -3597,3 +3597,38 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 void setColor(@NotNull ChatColor color); /** +diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/test/java/org/bukkit/AnnotationTest.java ++++ b/src/test/java/org/bukkit/AnnotationTest.java +@@ -0,0 +0,0 @@ import org.objectweb.asm.tree.ParameterNode; + public class AnnotationTest { + + private static final String[] ACCEPTED_ANNOTATIONS = { ++ // Paper start ++ "Lorg/checkerframework/checker/nullness/qual/Nullable;", ++ "Lorg/checkerframework/checker/nullness/qual/NonNull;", ++ "Lorg/checkerframework/checker/nullness/qual/PolyNull;", ++ "Lorg/checkerframework/checker/nullness/qual/MonotonicNonNull;", ++ // Paper end + "Lorg/jetbrains/annotations/Nullable;", + "Lorg/jetbrains/annotations/NotNull;", + "Lorg/jetbrains/annotations/Contract;", +@@ -0,0 +0,0 @@ public class AnnotationTest { + continue; + } + +- if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations)) { ++ if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations) && !isWellAnnotated(method.visibleTypeAnnotations)) { // Paper - also check visible type annotations + warn(errors, clazz, method, "return value"); + } + +@@ -0,0 +0,0 @@ public class AnnotationTest { + return true; + } + +- private static boolean isWellAnnotated(@Nullable List annotations) { ++ private static boolean isWellAnnotated(@Nullable List annotations) { // Paper - allow children of AnnotationNode + if (annotations == null) { + return false; + } diff --git a/Spigot-API-Patches/fix-Inventory-getContents-null-annotations.patch b/Spigot-API-Patches/fix-Inventory-getContents-null-annotations.patch index ce2e36032d..3554dc4da4 100644 --- a/Spigot-API-Patches/fix-Inventory-getContents-null-annotations.patch +++ b/Spigot-API-Patches/fix-Inventory-getContents-null-annotations.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - @NotNull - public ItemStack[] getContents(); - -+ public @Nullable ItemStack @NotNull [] getContents(); // Paper - make array elements nullable instead array ++ public @org.checkerframework.checker.nullness.qual.Nullable ItemStack @org.checkerframework.checker.nullness.qual.NonNull [] getContents(); // Paper - make array elements nullable instead array + /** * Completely replaces the inventory's contents. Removes all existing