Example #1
0
 /**
  * Transforms the given method type into a stack manipulation that loads its type onto the operand
  * stack.
  *
  * @param methodType The method type that should be loaded onto the operand stack.
  * @return A stack manipulation that loads the given method type.
  */
 public static StackManipulation of(JavaInstance.MethodType methodType) {
   Type[] parameterType = new Type[methodType.getParameterTypes().size()];
   int index = 0;
   for (TypeDescription typeDescription : methodType.getParameterTypes()) {
     parameterType[index++] = Type.getType(typeDescription.getDescriptor());
   }
   return new MethodTypeConstant(
       Type.getMethodType(
           Type.getType(methodType.getReturnType().getDescriptor()), parameterType));
 }