ServletRequestParamReader extends AbstractParamReader { protected static List<String> getParameterNames(EndpointMethod endpointMethod) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { List<String> parameterNames = endpointMethod.getParameterNames(); if (parameterNames == null) { Method method = endpointMethod.getMethod(); parameterNames = new ArrayList<>(); for (int parameter = 0; parameter < method.getParameterTypes().length; parameter++) { Annotation annotation = AnnotationUtil.getNamedParameter(method, parameter, Named.class); if (annotation == null) { parameterNames.add(null); } else { parameterNames.add((String) annotation.getClass().getMethod("value").invoke(annotation)); } } endpointMethod.setParameterNames(parameterNames); } return parameterNames; } ServletRequestParamReader(
      EndpointMethod method,
      EndpointsContext endpointsContext,
      ServletContext servletContext,
      ApiSerializationConfig serializationConfig,
      ApiMethodConfig methodConfig); @Override Object[] read();  }
@Test public void testNamesAreCached() throws Exception { class Test { @SuppressWarnings("unused") public void foo( @Nullable @Named("foo1") String f1, @Nullable @Named("foo2") String f2, @Nullable @Named("foo3") String f3) {} } Method method = Test.class.getDeclaredMethod("foo", String.class, String.class, String.class); EndpointMethod endpointMethod = EndpointMethod.create(method.getDeclaringClass(), method); readParameters("{}", endpointMethod); List<String> parameterNames = endpointMethod.getParameterNames(); assertEquals(3, parameterNames.size()); assertEquals("foo1", parameterNames.get(0)); assertEquals("foo2", parameterNames.get(1)); assertEquals("foo3", parameterNames.get(2)); }