@Test public void should_find_constructors_of_ScannerTest4() { scanner.findConstructors(codeBase, ScannerTest4.class); assertThat(codeBase.getSignatures().size(), is(3)); }
void findConstructors(CodeBase codeBase, Class<?> clazz) { logger.log(finest, "Analyzing " + clazz); try { Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors(); for (Constructor<?> constructor : declaredConstructors) { MethodSignature3 thisSignature = SignatureUtils.makeConstructorSignature(clazz, constructor); codeBase.addSignature(thisSignature); } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findConstructors(codeBase, innerClass); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }
CodeBaseScanner { void findConstructors(CodeBase codeBase, Class<?> clazz) { logger.log(finest, "Analyzing " + clazz); try { Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors(); for (Constructor<?> constructor : declaredConstructors) { MethodSignature3 thisSignature = SignatureUtils.makeConstructorSignature(clazz, constructor); codeBase.addSignature(thisSignature); } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findConstructors(codeBase, innerClass); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } } }
CodeBaseScanner { void findConstructors(CodeBase codeBase, Class<?> clazz) { logger.log(finest, "Analyzing " + clazz); try { Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors(); for (Constructor<?> constructor : declaredConstructors) { MethodSignature3 thisSignature = SignatureUtils.makeConstructorSignature(clazz, constructor); codeBase.addSignature(thisSignature); } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findConstructors(codeBase, innerClass); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }  }
CodeBaseScanner { void findConstructors(CodeBase codeBase, Class<?> clazz) { logger.log(finest, "Analyzing " + clazz); try { Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors(); for (Constructor<?> constructor : declaredConstructors) { MethodSignature3 thisSignature = SignatureUtils.makeConstructorSignature(clazz, constructor); codeBase.addSignature(thisSignature); } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findConstructors(codeBase, innerClass); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }  int scanSignatures(CodeBase codeBase); }
CodeBaseScanner { void findConstructors(CodeBase codeBase, Class<?> clazz) { logger.log(finest, "Analyzing " + clazz); try { Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors(); for (Constructor<?> constructor : declaredConstructors) { MethodSignature3 thisSignature = SignatureUtils.makeConstructorSignature(clazz, constructor); codeBase.addSignature(thisSignature); } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findConstructors(codeBase, innerClass); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }  int scanSignatures(CodeBase codeBase);  }