SPIGOT-2540: Add nullability annotations to entire Bukkit API

By: Darkyenus <darkyenus@gmail.com>
This commit is contained in:
Bukkit/Spigot
2019-03-13 17:42:57 +11:00
parent e069a80fd8
commit 416c865476
565 changed files with 5372 additions and 2008 deletions

View File

@@ -1,6 +1,7 @@
package org.bukkit.potion;
import org.apache.commons.lang.Validate;
import org.jetbrains.annotations.NotNull;
public final class PotionData {
@@ -18,7 +19,7 @@ public final class PotionData {
* @param upgraded whether the potion is upgraded PotionType#isUpgradable()
* must be true
*/
public PotionData(PotionType type, boolean extended, boolean upgraded) {
public PotionData(@NotNull PotionType type, boolean extended, boolean upgraded) {
Validate.notNull(type, "Potion Type must not be null");
Validate.isTrue(!upgraded || type.isUpgradeable(), "Potion Type is not upgradable");
Validate.isTrue(!extended || type.isExtendable(), "Potion Type is not extendable");
@@ -28,7 +29,7 @@ public final class PotionData {
this.upgraded = upgraded;
}
public PotionData(PotionType type) {
public PotionData(@NotNull PotionType type) {
this(type, false, false);
}
@@ -38,6 +39,7 @@ public final class PotionData {
*
* @return the potion type
*/
@NotNull
public PotionType getType() {
return type;
}