private Object[] executeAll(Object ctx, VariableResolverFactory vars, Method m) {
    if (length == 0) return GetterAccessor.EMPTY;

    Object[] vals = new Object[length];
    for (int i = 0; i < length - (m.isVarArgs() ? 1 : 0); i++) {
      vals[i] = parms[i].getValue(ctx, vars);
    }

    if (m.isVarArgs()) {
     if(parms == null){
        vals[length -1] = new Object[0];
     }
     else if (parms.length == length) {
          Object lastParam = parms[length - 1].getValue(ctx, vars);
          vals[length - 1] = lastParam == null || lastParam.getClass().isArray() ? lastParam : new Object[] {lastParam};
      } else {
        Object[] vararg = new Object[parms.length - length + 1];
        for (int i = 0; i < vararg.length; i++) vararg[i] = parms[length - 1 + i].getValue(ctx, vars);
        vals[length - 1] = vararg;
      }
    }

    return vals;
  }