Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
fix: make code java 11 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
TopchetoEU committed Nov 25, 2023
1 parent 8924e7a commit 4f22e76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/me/topchetoeu/jscript/engine/values/FunctionValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/me/topchetoeu/jscript/filesystem/FilesystemException.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public static enum FSCode {
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;
Expand Down
2 changes: 1 addition & 1 deletion src/me/topchetoeu/jscript/permissions/Permission.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ private static class State {

@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) {
Expand Down

0 comments on commit 4f22e76

Please sign in to comment.