Confuse confusing argument to varargs method
ci/woodpecker/push/docs Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2022-11-04 16:16:06 +01:00
parent 3de1bd0218
commit 45fe59df83
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 2 additions and 2 deletions

View File

@ -27,14 +27,14 @@ public class Main {
System.arraycopy(args, 1, newArgs, 0, args.length - 1);
Method mainMethod = mainClass.getMethod("main", String[].class);
MethodHandles.Lookup lookup = MethodHandles.lookup();
Runnable main = (Runnable) LambdaMetafactory.metafactory(
@SuppressWarnings("ConfusingArgumentToVarargsMethod") Runnable main = (Runnable) LambdaMetafactory.metafactory(
lookup,
"run",
MethodType.methodType(Runnable.class, String[].class),
MethodType.methodType(Void.TYPE),
MethodHandles.lookup().unreflect(mainMethod),
MethodType.methodType(Void.TYPE)
).getTarget().invokeExact(new Object[]{newArgs});
).getTarget().invokeExact(newArgs);
Thread th = new Thread(main);
th.setName("Minecraft");
th.start();