@Test public void testLoad() throws Exception { final DeclaredClass declaredClass = ClassLoader.load(inputStream); assertThat(declaredClass).isNotNull(); assertThat(declaredClass.methods()).isNotEmpty(); }
public static DeclaredClass load(InputStream in) throws IOException { ClassNode classNode = readClassNode(in); Set<ClassTypeDescriptor> parents = readParents(classNode); Set<DeclaredField> declaredFields = readDeclaredFields(classNode); Map<MethodDescriptor, DeclaredMethod> declaredMethods = new HashMap<>(); Set<ClassTypeDescriptor> loadedClasses = new HashSet<>(); for (MethodNode method : classNode.methods) { analyseMethod(classNode.name, method, declaredMethods, loadedClasses); } return new DeclaredClassBuilder() .className(TypeDescriptors.fromClassName(classNode.name)) .methods(declaredMethods) .parents(parents) .loadedClasses(loadedClasses) .fields(declaredFields) .build(); }
ClassLoader { public static DeclaredClass load(InputStream in) throws IOException { ClassNode classNode = readClassNode(in); Set<ClassTypeDescriptor> parents = readParents(classNode); Set<DeclaredField> declaredFields = readDeclaredFields(classNode); Map<MethodDescriptor, DeclaredMethod> declaredMethods = new HashMap<>(); Set<ClassTypeDescriptor> loadedClasses = new HashSet<>(); for (MethodNode method : classNode.methods) { analyseMethod(classNode.name, method, declaredMethods, loadedClasses); } return new DeclaredClassBuilder() .className(TypeDescriptors.fromClassName(classNode.name)) .methods(declaredMethods) .parents(parents) .loadedClasses(loadedClasses) .fields(declaredFields) .build(); } }
ClassLoader { public static DeclaredClass load(InputStream in) throws IOException { ClassNode classNode = readClassNode(in); Set<ClassTypeDescriptor> parents = readParents(classNode); Set<DeclaredField> declaredFields = readDeclaredFields(classNode); Map<MethodDescriptor, DeclaredMethod> declaredMethods = new HashMap<>(); Set<ClassTypeDescriptor> loadedClasses = new HashSet<>(); for (MethodNode method : classNode.methods) { analyseMethod(classNode.name, method, declaredMethods, loadedClasses); } return new DeclaredClassBuilder() .className(TypeDescriptors.fromClassName(classNode.name)) .methods(declaredMethods) .parents(parents) .loadedClasses(loadedClasses) .fields(declaredFields) .build(); } private  ClassLoader(); }
ClassLoader { public static DeclaredClass load(InputStream in) throws IOException { ClassNode classNode = readClassNode(in); Set<ClassTypeDescriptor> parents = readParents(classNode); Set<DeclaredField> declaredFields = readDeclaredFields(classNode); Map<MethodDescriptor, DeclaredMethod> declaredMethods = new HashMap<>(); Set<ClassTypeDescriptor> loadedClasses = new HashSet<>(); for (MethodNode method : classNode.methods) { analyseMethod(classNode.name, method, declaredMethods, loadedClasses); } return new DeclaredClassBuilder() .className(TypeDescriptors.fromClassName(classNode.name)) .methods(declaredMethods) .parents(parents) .loadedClasses(loadedClasses) .fields(declaredFields) .build(); } private  ClassLoader(); static DeclaredClass load(InputStream in); }
ClassLoader { public static DeclaredClass load(InputStream in) throws IOException { ClassNode classNode = readClassNode(in); Set<ClassTypeDescriptor> parents = readParents(classNode); Set<DeclaredField> declaredFields = readDeclaredFields(classNode); Map<MethodDescriptor, DeclaredMethod> declaredMethods = new HashMap<>(); Set<ClassTypeDescriptor> loadedClasses = new HashSet<>(); for (MethodNode method : classNode.methods) { analyseMethod(classNode.name, method, declaredMethods, loadedClasses); } return new DeclaredClassBuilder() .className(TypeDescriptors.fromClassName(classNode.name)) .methods(declaredMethods) .parents(parents) .loadedClasses(loadedClasses) .fields(declaredFields) .build(); } private  ClassLoader(); static DeclaredClass load(InputStream in);  }