0
Java에서 메서드 조회를위한 MethodType을 만들지 못했습니다. 아래는 제 코드입니다. 이 코드에서는 sample :: gwd 메서드에 대한 MethodType을 만든 다음 lookup(). findStatic에 의해이 함수에 대한 참조를 검색하려고합니다. MethodType이 잘못 작성 되었기 때문에 메서드 참조를 얻을 수 없다는 것은 분명합니다.변형 매개 변수가있는 메서드의 MethodType을 구성하는 방법
//I want to construct MethodType for Sample:gwd method, but do not know how to handle array parameters for 'gwd' method
MethodType mt = MethodType.methodType(Object.class, MethodHandle.class, MethodHandle.class, MethodHandle.class);
MethodHandle myMH = MethodHandles.lookup().findStatic(Sample.Class, "gwd", mt);
public class Sample
{
public static Object gwd(MethodHandle methodhandle, MethodHandle methodhandle1, MethodHandle methodhandle2, Object aobj[])
throws Throwable
{ .......... }
}
누구라도 도와 드릴까요?