Skip to content

Commit

Permalink
Fix wrong unknown nullability on suppress warning enum (#7366)
Browse files Browse the repository at this point in the history
* Fix wrong unknown nullability on suppress warning enum

* Update aliases

* Requested changes

* Revert long line field
  • Loading branch information
TheLimeGlass authored Jan 3, 2025
1 parent 6abee66 commit 57e8fe5
Showing 1 changed file with 4 additions and 6 deletions.
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

0 comments on commit 57e8fe5

Please sign in to comment.