Setting#toString now throws an exception

Setting#toString used to return the String value of the setting, and
since that implementation is no longer present this method should not
be called.
This commit is contained in:
Rsl1122 2018-12-16 14:42:48 +02:00
parent 715111b433
commit 5dcdd0b9b1

View File

@ -72,4 +72,13 @@ public abstract class Setting<T> {
public boolean isValid(T value) { public boolean isValid(T value) {
return validator.test(value); return validator.test(value);
} }
@Override
public String toString() {
throw new UnsupportedOperationException(
"Setting#toString should not be called, relies on old behavior. " +
"Use getValueFrom(ConfigNode) instead. " +
"(Called path: '" + path + "')"
);
}
} }