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 PropertyExpression's expr annotation #7169

Open
wants to merge 11 commits into
base: dev/feature
Choose a base branch
from
2 changes: 1 addition & 1 deletion src/main/java/ch/njol/skript/expressions/ExprTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public Class<?>[] acceptChange(final ChangeMode mode) {

@Override
public void change(Event event, Object @Nullable [] delta, ChangeMode mode) {
if (getExpr() == null || delta == null)
sovdeeth marked this conversation as resolved.
Show resolved Hide resolved
if (delta == null)
return;

Object time = delta[0];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package ch.njol.skript.expressions.base;


import ch.njol.skript.Skript;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.SyntaxElement;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean;
import com.google.common.base.Preconditions;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.UnknownNullability;
import org.skriptlang.skript.lang.converter.Converter;
import org.skriptlang.skript.lang.converter.Converters;

Expand Down Expand Up @@ -95,15 +96,15 @@ public static <T> void registerDefault(Class<? extends Expression<T>> expression
Skript.registerExpression(expressionClass, type, ExpressionType.PROPERTY, getDefaultPatterns(property, fromType));
}

@Nullable
private Expression<? extends F> expr;
private @UnknownNullability Expression<? extends F> expr;

/**
* Sets the expression this expression represents a property of. No reference to the expression should be kept.
*
* @param expr
* @param expr The expression this expression represents a property of.
*/
protected final void setExpr(Expression<? extends F> expr) {
protected final void setExpr(@NotNull Expression<? extends F> expr) {
Preconditions.checkNotNull(expr, "The expr param cannot be null");
this.expr = expr;
}

Expand Down