fix: make code java 11 compatible

This commit is contained in:
TopchetoEU 2023-11-25 20:22:16 +02:00
parent 8924e7aadc
commit 4f22e76d2b
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
3 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ public abstract class FunctionValue extends ObjectValue {
@Override
public String toString() {
return "function %s(...)".formatted(name);
return String.format("function %s(...)", name);
}
public abstract Object call(Context ctx, Object thisArg, Object ...args);

View File

@ -34,13 +34,13 @@ public class FilesystemException extends RuntimeException {
public final FSCode code;
public FilesystemException(String message, String filename, FSCode code) {
super(code + ": " + message.formatted(filename));
super(code + ": " + String.format(message, filename));
this.message = message;
this.code = code;
this.filename = filename;
}
public FilesystemException(String filename, FSCode code) {
super(code + ": " + MESSAGES[code.code].formatted(filename));
super(code + ": " + String.format(MESSAGES[code.code], filename));
this.message = MESSAGES[code.code];
this.code = code;
this.filename = filename;

View File

@ -9,7 +9,7 @@ public class Permission {
@Override
public String toString() {
return "State [pr=%s;trg=%s;wildN=%s;wild=%s]".formatted(predI, trgI, wildcardI, wildcard);
return String.format("State [pr=%s;trg=%s;wildN=%s;wild=%s]", predI, trgI, wildcardI, wildcard);
}
public State(int predicateI, int targetI, int wildcardI, boolean wildcard) {