Source:
@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) { if (!env.processingOver()) { for (Element e : env.getElementsAnnotatedWith(Module.class)) { if (!(e instanceof TypeElement)) { error("@Module applies to a type, " + e.getSimpleName() + " is a " + e.getKind(), e); continue; } delayedModuleNames.add(((TypeElement) e).getQualifiedName().toString()); } return true; } Set<Element> modules = new LinkedHashSet<Element>(); for (String moduleName : delayedModuleNames) { modules.add(processingEnv.getElementUtils().getTypeElement(moduleName)); } for (Element element : modules) { Map<String, Object> annotation = CodeGen.getAnnotation(Module.class, element); TypeElement moduleType = (TypeElement) element; ProblemDetector problemDetector = new ProblemDetector(); if (annotation.get("library").equals(Boolean.FALSE)) { Map<String, Binding<?>> bindings = processCompleteModule(moduleType, true); try { problemDetector.detectUnusedBinding(bindings.values()); } catch (IllegalStateException e) { error("Graph validation failed: " + e.getMessage(), moduleType); } } if (annotation.get("complete").equals(Boolean.TRUE)) { Map<String, Binding<?>> bindings = processCompleteModule(moduleType, false); try { problemDetector.detectCircularDependencies(bindings.values()); } catch (IllegalStateException e) { error("Graph validation failed: " + e.getMessage(), moduleType); continue; } try { writeDotFile(moduleType, bindings); } catch (IOException e) { error("Graph visualization failed: " + e, moduleType); } } } return true; }

Target:
@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) { if (!env.processingOver()) { for (Element e : env.getElementsAnnotatedWith(Module.class)) { if (!(e instanceof TypeElement)) { error("@Module applies to a type, " + e.getSimpleName() + " is a " + e.getKind(), e); continue; } delayedModuleNames.add(((TypeElement) e).getQualifiedName().toString()); } return true; } Set<Element> modules = new LinkedHashSet<Element>(); for (String moduleName : delayedModuleNames) { modules.add(processingEnv.getElementUtils().getTypeElement(moduleName)); } for (Element element : modules) { Map<String, Object> annotation = CodeGen.getAnnotation(Module.class, element); TypeElement moduleType = (TypeElement) element; if (annotation.get("complete").equals(Boolean.TRUE)) { Map<String, Binding<?>> bindings; try { bindings = processCompleteModule(moduleType, false); new ProblemDetector().detectCircularDependencies(bindings.values()); } catch (ModuleValidationException e) { error("Graph validation failed: " + e.getMessage(), e.source); continue; } catch (IllegalStateException e) { error("Graph validation failed: " + e.getMessage(), moduleType); continue; } try { writeDotFile(moduleType, bindings); } catch (IOException e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); processingEnv.getMessager() .printMessage(Diagnostic.Kind.WARNING, "Graph visualization failed. Please report this as a bug.\n\n" + sw, moduleType); } } if (annotation.get("library").equals(Boolean.FALSE)) { Map<String, Binding<?>> bindings = processCompleteModule(moduleType, true); try { new ProblemDetector().detectUnusedBinding(bindings.values()); } catch (IllegalStateException e) { error("Graph validation failed: " + e.getMessage(), moduleType); } } } return true; }