public void visitExecutableDeclaration(ExecutableDeclaration d) {
    d.accept(pre);

    SortedSet<Declaration> decls = new TreeSet<Declaration>(SourceOrderDeclScanner.comparator);

    for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) decls.add(tpDecl);

    for (ParameterDeclaration pDecl : d.getParameters()) decls.add(pDecl);

    for (Declaration decl : decls) decl.accept(this);

    d.accept(post);
  }
 private Thing setupMethod(ExecutableDeclaration declaration, boolean forceNonAbstract) {
   String name = null;
   String returnType = null;
   boolean isAbstract = false;
   String nullBody = null;
   String throwsClause = "";
   if (declaration instanceof ConstructorDeclaration) {
     name = "<init>";
   } else {
     MethodDeclaration methodDeclaration = (MethodDeclaration) declaration;
     name = methodDeclaration.getSimpleName();
     returnType = methodDeclaration.getReturnType().toString();
     if (!forceNonAbstract) {
       isAbstract = methodDeclaration.getModifiers().contains(Modifier.ABSTRACT);
     }
     if ("void".equals(returnType)) {
       nullBody = "// null object implementation; do nothing";
     } else if ("boolean".equals(returnType)) {
       nullBody = "false; // null object implementation";
     } else if ("char".equals(returnType)) {
       nullBody = "' '; // null object implementation";
     } else if (BeanAnnotationProcessor.PRIMITIVE_TYPES.contains(returnType)) {
       nullBody = "0; // null object implementation";
     } else {
       nullBody = "null; // null object implementation";
     }
   }
   Collection<ReferenceType> thrownTypes = declaration.getThrownTypes();
   if (!thrownTypes.isEmpty()) {
     throwsClause = "throws " + commaSeparate(thrownTypes);
   }
   String genericDecls = null;
   String argDecls = null;
   String args = null;
   String modifiers = "";
   Collection<ParameterDeclaration> parameters = declaration.getParameters();
   for (ParameterDeclaration parameterDeclaration : parameters) {
     argDecls =
         addWithCommasBetween(
             argDecls,
             parameterDeclaration.getType() + " " + parameterDeclaration.getSimpleName());
     args = addWithCommasBetween(args, parameterDeclaration.getSimpleName());
   }
   Collection<TypeParameterDeclaration> formalTypeParameters =
       declaration.getFormalTypeParameters();
   for (TypeParameterDeclaration typeParameterDeclaration : formalTypeParameters) {
     genericDecls = addWithCommasBetween(genericDecls, typeParameterDeclaration);
   }
   Collection<Modifier> modifiers2 = declaration.getModifiers();
   for (Modifier modifier : modifiers2) {
     if (!"abstract".equals(modifier.toString())) {
       modifiers += modifier.toString() + ' ';
     }
   }
   if (genericDecls == null) {
     genericDecls = "";
   } else {
     genericDecls = '<' + genericDecls + "> ";
   }
   Thing method = new Thing("method");
   method.put("name", name);
   method.put("returnType", returnType);
   method.put("abstract", isAbstract);
   method.put("nullBody", nullBody);
   method.put("modifiers", modifiers); // do not normalize; already "" or has ' ' at end
   method.put("argDecls", normalizeList(argDecls));
   method.put("args", normalizeList(args));
   method.put("genericDecls", genericDecls);
   method.put("throwsClause", throwsClause);
   return method;
 }