Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong unknown nullability on suppress warning enum #7366

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import ch.njol.skript.lang.parser.ParserInstance;
import ch.njol.util.Kleenean;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnknownNullability;

/**
* An enum containing {@link Script} warnings that can be suppressed.
Expand Down Expand Up @@ -46,7 +45,7 @@ public enum ScriptWarning {

private final String warningName;
private final String pattern;
private final @UnknownNullability String deprecationMessage;
private final @Nullable String deprecationMessage;

ScriptWarning(String warningName) {
this(warningName, warningName);
Expand Down Expand Up @@ -75,16 +74,15 @@ public boolean isDeprecated() {
}

/**
* Returns the deprecation message of this warning, or null if the warning isn't deprecated.
* @return The deprecation message.
* @return The deprecation message of this warning, or null if the warning isn't deprecated.
* @see #isDeprecated()
*/
public @UnknownNullability String getDeprecationMessage() {
public String getDeprecationMessage() {
return deprecationMessage;
}

/**
* Prints the given message using {@link Skript#warning(String)} iff the current script does not suppress deprecation warnings.
* Prints the given message using {@link Skript#warning(String)} if and only if the current script does not suppress deprecation warnings.
* Intended for use in {@link ch.njol.skript.lang.SyntaxElement#init(Expression[], int, Kleenean, SkriptParser.ParseResult)}.
* The given message is prefixed with {@code "[Deprecated] "} to provide a common link between deprecation warnings.
*
Expand Down
Loading