use of com.newrelic.weave.utils.ClassInformation.MemberInformation in project newrelic-java-agent by newrelic.
the class Reference method addMethodsAndFields.
/**
* Fetch all methods and fields of a class node including those inherited from supertypes+interfaces. The results
* will be stored in the passed in methods and fields lists.
*
* @param classCache Cache to use to fetch supertype resources
* @param classNode The node to scan
* @param methods classNode's methods will be appended to this list.
* @param fields classNode's fields will be appended to this list.
*/
private static void addMethodsAndFields(ClassCache classCache, ClassNode classNode, List<MethodNode> methods, List<FieldNode> fields) throws IOException {
ClassInformation classInfo = classCache.getClassInformation(classNode.name);
for (MemberInformation methodInfo : classInfo.getAllMethods(classCache)) {
MethodNode methodNode = new SynchronizedMethodNode();
methodNode.name = methodInfo.name;
methodNode.desc = methodInfo.desc;
methodNode.access = methodInfo.access;
methods.add(methodNode);
}
for (MemberInformation fieldInfo : classInfo.getAllFields(classCache)) {
fields.add(new SynchronizedFieldNode(WeaveUtils.ASM_API_LEVEL, fieldInfo.access, fieldInfo.name, fieldInfo.desc, null, null));
}
}
Aggregations