code: public void genDef(JCTree tree, Env<GenContext> env) {
          Env<GenContext> prevEnv = this.env;
          try {
              this.env = env;
              tree.accept(this);
          } catch (CompletionFailure ex) {
              chk.completionError(tree.pos(), ex);
          } finally {
              this.env = prevEnv;
          }
      }
docs: Visitor method: generate code for a definition, catching and reporting
  any completion failures.
  @param tree    The definition to be visited.
  @param env     The environment current at the definition.