code: void commit() {
      if (committed) {
        errorManager.logError("Committed the fragment for %s twice.", fragmentPackageName);
        return;
      }
  
      committed = true;
  
      // Write the field where the enclosing injector is stored.
      writer.beginJavaDocComment();
      writer.print("Field for the enclosing injector.");
      writer.endJavaDocComment();
      writer.println("private final %s injector;", ginjectorClassName);
  
      // Write the constructor, which takes the enclosing injector and does
      // nothing but store it in a field.  It's important that the constructor has
      // no other side-effects; in particular, it must not call any injector
      // methods, since the injector might not be fully constructed.
      sourceWriteUtil.writeMethod(writer,
          String.format("public %s(%s injector)", fragmentClassName, ginjectorClassName),
          "this.injector = injector;");
  
      if (hasEagerSingletonInitialization()) {
        // Write a method to initialize eager singletons.
        sourceWriteUtil.writeMethod(
            writer,
            "public void initializeEagerSingletons()",
            initializeEagerSingletonsBody.toString());
      }
  
      if (hasStaticInjectionInitialization()) {
        // Write a method to initialize static injection.
        sourceWriteUtil.writeMethod(
            writer,
            "public void initializeStaticInjections()",
            initializeStaticInjectionsBody.toString());
      }
  
      writer.commit(logger);
    }
docs: Outputs all the top-level methods and fields of the class, and commits the
  writer.  Must be the last method invoked on this object.