Add checkerframework nullness annotations to accepted list for AnnotationTest (#5409)

Also use checkerframework annotations instead of jetbrains ones for Inventory#getContents as jetbrains ones do not allow properly annotating the nullability of an array and it's contents.
This commit is contained in:
Jason 2021-03-24 03:02:32 -07:00 committed by GitHub
parent 7259c32bac
commit 6caa330c61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 9 deletions

View file

@ -5,7 +5,7 @@ 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
index 6386206188e820206bb1a9f516b5e194fdc9d952..7956aebcb390379677dccf7c9561866cf94c024c 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<ItemStack> {
@ -15,7 +15,7 @@ index 6386206188e820206bb1a9f516b5e194fdc9d952..607eb670b5e6adc2a4dce81b6e56b219
- @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