code: protected int writeEnclosingMethodAttribute(Name attributeName, ClassSymbol c) {
          if (c.owner.kind != MTH && // neither a local class
              c.name != names.empty) // nor anonymous
              return 0;
  
          int alenIdx = writeAttr(attributeName);
          ClassSymbol enclClass = c.owner.enclClass();
          MethodSymbol enclMethod =
              (c.owner.type == null // local to init block
               || c.owner.kind != MTH) // or member init
              ? null
              : (MethodSymbol)c.owner;
          databuf.appendChar(pool.put(enclClass));
          databuf.appendChar(enclMethod == null ? 0 : pool.put(nameType(c.owner)));
          endAttr(alenIdx);
          return 1;
      }
docs: Write the EnclosingMethod attribute with a specified name.
  Returns the number of attributes written (0 or 1).