if(arguments==null) throw new MethodNotArgumentized(method);
Class<?>[] parameterTypes = method.getParameterTypes();
int nParams = parameterTypes.length;
if(rep.lexer.yylex() != Yytoken.TYPE_LEFT_SQUARE) throw new ParseException("Method "+method.getName()+" args["+nParams+"] expected");
if(nParams == 0) {
if(rep.lexer.yylex() != Yytoken.TYPE_RIGHT_SQUARE) throw new ParseException("Method "+method.getName()+" empty args[] expected");
return null;
}
Type[] genericParameterTypes = method.getGenericParameterTypes();
Object[] params = new Object[nParams];
for(int i = 0; i < nParams; i++) {
Class<?> clazz = parameterTypes[i];
Type type = genericParameterTypes[i];
if(clazz.isAssignableFrom(HttpServletRequest.class)) {
if(rep.lexer.yylex() != Yytoken.TYPE_VALUE || rep.lexer.value != null) throw new ParseException("HttpServlet should be null");
params[i] = request;
} else {
params[i] = rep.getObject(clazz, type);
}
rep.lexer.yylex();
if(i == nParams-1 && rep.lexer.type == Yytoken.TYPE_RIGHT_SQUARE) break;
if(rep.lexer.type != Yytoken.TYPE_COMMA) throw new ParseException("no , or ] in method params");
}
if(rep.lexer.type != Yytoken.TYPE_RIGHT_SQUARE) throw new ParseException("Method "+method.getName()+": bad args");
return params;
}