Skip to content

Commit

Permalink
Mark arguments as final
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
DieKautz committed Jan 24, 2024
1 parent 705e254 commit fa31696
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ public TruffleClosure(final SqueakImageContext context, final TruffleExecutable
}

public interface ITruffleExecutable {
Object execute(Object... arguments);
Object execute(final Object... arguments);
}

@FunctionalInterface
public interface TruffleSupplier<R> extends ITruffleExecutable {
R run();

default Object execute(Object... arguments) {
default Object execute(final Object... arguments) {
assert arguments.length == 0;
return run();
}
Expand All @@ -100,7 +100,7 @@ public interface TruffleFunction<T, R> extends ITruffleExecutable {
R run(T argument);

@SuppressWarnings("unchecked")
default Object execute(Object... arguments) {
default Object execute(final Object... arguments) {
assert arguments.length == 1;
return run((T) arguments[0]);
}
Expand All @@ -111,7 +111,7 @@ public interface TruffleBiFunction<S, T, R> extends ITruffleExecutable {
R run(S argument1, T argument2);

@SuppressWarnings("unchecked")
default Object execute(Object... arguments) {
default Object execute(final Object... arguments) {
assert arguments.length == 2;
return run((S) arguments[0], (T) arguments[1]);
}
Expand All @@ -122,7 +122,7 @@ public interface TruffleTriFunction<S, T, U, R> extends ITruffleExecutable {
R run(S argument1, T argument2, U argument3);

@SuppressWarnings("unchecked")
default Object execute(Object... arguments) {
default Object execute(final Object... arguments) {
assert arguments.length == 3;
return run((S) arguments[0], (T) arguments[1], (U) arguments[2]);
}
Expand All @@ -133,7 +133,7 @@ public interface TruffleQuadFunction<S, T, U, V, R> extends ITruffleExecutable {
R run(S argument1, T argument2, U argument3, V argument4);

@SuppressWarnings("unchecked")
default Object execute(Object... arguments) {
default Object execute(final Object... arguments) {
assert arguments.length == 4;
return run((S) arguments[0], (T) arguments[1], (U) arguments[2], (V) arguments[3]);
}
Expand All @@ -144,7 +144,7 @@ public interface TruffleQuintFunction<S, T, U, V, W, R> extends ITruffleExecutab
R run(S argument1, T argument2, U argument3, V argument4, W argument5);

@SuppressWarnings("unchecked")
default Object execute(Object... arguments) {
default Object execute(final Object... arguments) {
assert arguments.length == 5;
return run((S) arguments[0], (T) arguments[1], (U) arguments[2], (V) arguments[3], (W) arguments[4]);
}
Expand Down

0 comments on commit fa31696

Please sign in to comment.