@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { // exclude synthetic + bridged && static class initialization if (!isSyntheticOrBridged(access) && !STATIC_CLASS_INIT.equals(name)) { return new LocalVariableTableVisitor(clazz, memberMap, name, desc, isStatic(access)); } return null; }
/** * Inspects the target class. Exceptions will be logged and a maker map returned to indicate the lack of debug * information. */ private Map<Member, String[]> inspectClass(Class<?> clazz) { InputStream is = clazz.getResourceAsStream(Classes.getClassFileName(clazz)); if (is == null) { // We couldn't load the class file, which is not fatal as it // simply means this method of discovering parameter names won't work. return NO_DEBUG_INFO_MAP; } try { ClassReader classReader = new ClassReader(is); Map<Member, String[]> map = new ConcurrentHashMap<Member, String[]>(); classReader.accept(new ParameterNameDiscoveringVisitor(clazz, map), 0); return map; } catch (IOException ex) { if (log.isDebugEnabled()) { log.debug("Exception thrown while reading '.class' file for class [" + clazz + "] - unable to determine constructors/methods parameter names", ex); } } finally { try { is.close(); } catch (IOException ex) { // ignore } } return NO_DEBUG_INFO_MAP; }