LocalVariableTableParameterNameDiscoverer { public String[] getParameterNames(Method originalMethod) { Class<?> declaringClass = originalMethod.getDeclaringClass(); Map<Member, String[]> map = this.parameterNamesCache.get(declaringClass); if (map == null) { map = inspectClass(declaringClass); this.parameterNamesCache.put(declaringClass, map); } if (map != NO_DEBUG_INFO_MAP) { return map.get(originalMethod); } return null; }  String[] getParameterNames(Method originalMethod); String[] getParameterNames(Constructor<?> ctor); static String getClassFileName(Class<?> clazz); static final String CLASS_FILE_SUFFIX; }
@Test public void test() { String[] parameterNames; parameterNames = DISCOVERER.getParameterNames(CLASS_NO_PARAM_METHOD); Assert.assertTrue(CommonUtils.isEmpty(parameterNames)); parameterNames = DISCOVERER.getParameterNames(CLASS_ONE_PARAM_METHOD); Assert.assertEquals("a", parameterNames[0]); parameterNames = DISCOVERER.getParameterNames(CLASS_MULTI_PARAM_METHOD); Assert.assertEquals("a", parameterNames[0]); Assert.assertEquals("b", parameterNames[1]); }