From 0e06e912ec3e6f4623960cf4586138480f2b2fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Stefa=C5=84czyk?= Date: Tue, 23 Mar 2021 15:51:08 +0100 Subject: [PATCH] Fix annotations so Inventory#getContents returns non-null array with nullable type (#5350) --- ...ventory-getContents-null-annotations.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Spigot-API-Patches/0282-fix-Inventory-getContents-null-annotations.patch diff --git a/Spigot-API-Patches/0282-fix-Inventory-getContents-null-annotations.patch b/Spigot-API-Patches/0282-fix-Inventory-getContents-null-annotations.patch new file mode 100644 index 000000000..186fb3a9a --- /dev/null +++ b/Spigot-API-Patches/0282-fix-Inventory-getContents-null-annotations.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: CDFN +Date: Fri, 12 Mar 2021 18:31:31 +0100 +Subject: [PATCH] fix Inventory#getContents null annotations + + +diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java +index 6386206188e820206bb1a9f516b5e194fdc9d952..607eb670b5e6adc2a4dce81b6e56b219c8a4f95f 100644 +--- a/src/main/java/org/bukkit/inventory/Inventory.java ++++ b/src/main/java/org/bukkit/inventory/Inventory.java +@@ -158,9 +158,8 @@ public interface Inventory extends Iterable { + * + * @return An array of ItemStacks from the inventory. Individual items may be null. + */ +- @NotNull +- public ItemStack[] getContents(); +- ++ public @Nullable ItemStack @NotNull [] getContents(); // Paper - make array elements nullable instead array ++ + /** + * Completely replaces the inventory's contents. Removes all existing + * contents and replaces it with the ItemStacks given in the array.