(Executable method, int argCount)
| 1403 | } |
| 1404 | |
| 1405 | private static void checkMethodArity(Executable method, int argCount) { |
| 1406 | if(method.getParameterCount() != argCount) |
| 1407 | throw new IllegalArgumentException("Invocation of " |
| 1408 | + methodDescription(method.getDeclaringClass(), |
| 1409 | (method instanceof Constructor) ? "new" : method.getName()) |
| 1410 | + " expected " + method.getParameterCount() + " arguments, but received " + argCount); |
| 1411 | } |
| 1412 | |
| 1413 | private static String methodDescription(Class c, String methodName) { |
| 1414 | boolean isCtor = c != null && methodName.equals("new"); |
no test coverage detected