@Test public void should_find_base_methods_of_ScannerTest4() { scanner.findMethods(codeBase, ScannerTest4.class, codeBase.getConfig().getNormalizedPackages()); assertThat(codeBase.getSignatures().size(), is(11)); }
void findMethods(CodeBase codeBase, Class<?> clazz, List<String> packages) { logger.log(finest, "Analyzing " + clazz); try { Method[] declaredMethods = clazz.getDeclaredMethods(); for (Method method : declaredMethods) { boolean ignored = true; MethodSignature3 signature = SignatureUtils.makeMethodSignature(clazz, method); if (signature == null) { logger.log(finest, "Ignoring method " + method + ", cannot make AspectJ signature"); } else { String declaringPackage = method.getDeclaringClass().getPackage().getName(); for (String pkg : packages) { if (declaringPackage.startsWith(pkg)) { codeBase.addSignature(signature); ignored = false; } } } if (ignored) { logger.log(finest, "Ignored " + signature); } } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findMethods(codeBase, innerClass, packages); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }
CodeBaseScanner { void findMethods(CodeBase codeBase, Class<?> clazz, List<String> packages) { logger.log(finest, "Analyzing " + clazz); try { Method[] declaredMethods = clazz.getDeclaredMethods(); for (Method method : declaredMethods) { boolean ignored = true; MethodSignature3 signature = SignatureUtils.makeMethodSignature(clazz, method); if (signature == null) { logger.log(finest, "Ignoring method " + method + ", cannot make AspectJ signature"); } else { String declaringPackage = method.getDeclaringClass().getPackage().getName(); for (String pkg : packages) { if (declaringPackage.startsWith(pkg)) { codeBase.addSignature(signature); ignored = false; } } } if (ignored) { logger.log(finest, "Ignored " + signature); } } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findMethods(codeBase, innerClass, packages); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } } }
CodeBaseScanner { void findMethods(CodeBase codeBase, Class<?> clazz, List<String> packages) { logger.log(finest, "Analyzing " + clazz); try { Method[] declaredMethods = clazz.getDeclaredMethods(); for (Method method : declaredMethods) { boolean ignored = true; MethodSignature3 signature = SignatureUtils.makeMethodSignature(clazz, method); if (signature == null) { logger.log(finest, "Ignoring method " + method + ", cannot make AspectJ signature"); } else { String declaringPackage = method.getDeclaringClass().getPackage().getName(); for (String pkg : packages) { if (declaringPackage.startsWith(pkg)) { codeBase.addSignature(signature); ignored = false; } } } if (ignored) { logger.log(finest, "Ignored " + signature); } } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findMethods(codeBase, innerClass, packages); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }  }
CodeBaseScanner { void findMethods(CodeBase codeBase, Class<?> clazz, List<String> packages) { logger.log(finest, "Analyzing " + clazz); try { Method[] declaredMethods = clazz.getDeclaredMethods(); for (Method method : declaredMethods) { boolean ignored = true; MethodSignature3 signature = SignatureUtils.makeMethodSignature(clazz, method); if (signature == null) { logger.log(finest, "Ignoring method " + method + ", cannot make AspectJ signature"); } else { String declaringPackage = method.getDeclaringClass().getPackage().getName(); for (String pkg : packages) { if (declaringPackage.startsWith(pkg)) { codeBase.addSignature(signature); ignored = false; } } } if (ignored) { logger.log(finest, "Ignored " + signature); } } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findMethods(codeBase, innerClass, packages); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }  int scanSignatures(CodeBase codeBase); }
CodeBaseScanner { void findMethods(CodeBase codeBase, Class<?> clazz, List<String> packages) { logger.log(finest, "Analyzing " + clazz); try { Method[] declaredMethods = clazz.getDeclaredMethods(); for (Method method : declaredMethods) { boolean ignored = true; MethodSignature3 signature = SignatureUtils.makeMethodSignature(clazz, method); if (signature == null) { logger.log(finest, "Ignoring method " + method + ", cannot make AspectJ signature"); } else { String declaringPackage = method.getDeclaringClass().getPackage().getName(); for (String pkg : packages) { if (declaringPackage.startsWith(pkg)) { codeBase.addSignature(signature); ignored = false; } } } if (ignored) { logger.log(finest, "Ignored " + signature); } } for (Class<?> innerClass : clazz.getDeclaredClasses()) { findMethods(codeBase, innerClass, packages); } } catch (NoClassDefFoundError e) { logger.warning(String.format("Cannot analyze %s: %s", clazz, e.toString())); } }  int scanSignatures(CodeBase codeBase);  }