code: public boolean genClass(Env<AttrContext> env, JCClassDecl cdef) {
          try {
              attrEnv = env;
              ClassSymbol c = cdef.sym;
              this.toplevel = env.toplevel;
              this.endPosTable = toplevel.endPositions;
              c.pool = pool;
              pool.reset();
              /* method normalizeDefs() can add references to external classes into the constant pool
               */
              cdef.defs = normalizeDefs(cdef.defs, c);
              generateReferencesToPrunedTree(c, pool);
              Env<GenContext> localEnv = new Env<>(cdef, new GenContext());
              localEnv.toplevel = env.toplevel;
              localEnv.enclClass = cdef;
  
              for (List<JCTree> l = cdef.defs; l.nonEmpty(); l = l.tail) {
                  genDef(l.head, localEnv);
              }
              if (pool.numEntries() > Pool.MAX_ENTRIES) {
                  log.error(cdef.pos(), "limit.pool");
                  nerrs++;
              }
              if (nerrs != 0) {
                  // if errors, discard code
                  for (List<JCTree> l = cdef.defs; l.nonEmpty(); l = l.tail) {
                      if (l.head.hasTag(METHODDEF))
                          ((JCMethodDecl) l.head).sym.code = null;
                  }
              }
              cdef.defs = List.nil(); // discard trees
              return nerrs == 0;
          } finally {
              // note: this method does NOT support recursion.
              attrEnv = null;
              this.env = null;
              toplevel = null;
              endPosTable = null;
              nerrs = 0;
          }
      }
docs: Generate code for a class definition.
  @param env   The attribution environment that belongs to the
  outermost class containing this class definition.
  We need this for resolving some additional symbols.
  @param cdef  The tree representing the class definition.
  @return      True if code is generated with no errors.