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

@@ -7,6 +7,8 @@ import java.lang.annotation.Target;
import java.util.Map;
import com.google.common.collect.ImmutableMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* This designates the warning state for a specific item.
@@ -65,7 +67,7 @@ public @interface Warning {
* specifies false for {@link Warning#value()}, true otherwise.
* </ul>
*/
public boolean printFor(Warning warning) {
public boolean printFor(@Nullable Warning warning) {
if (this == DEFAULT) {
return warning == null || warning.value();
}
@@ -80,7 +82,8 @@ public @interface Warning {
* @return {@link #DEFAULT} if not found, or the respective
* WarningState
*/
public static WarningState value(final String value) {
@NotNull
public static WarningState value(@Nullable final String value) {
if (value == null) {
return DEFAULT;
}