private int writeRootFields(int rootId,
                              @NotNull String name,
                              boolean caseSensitive,
                              @NotNull FileAttributes attributes) {
    assert rootId > 0 : rootId;
    //RC: why we reject the changes in those 2 cases -- what is special with loaded children or
    //    same-name?
    //    A guess: we call the method from findRoot() -- always, even if the root already exists in
    //    persistence -- but we don't want to really overwrite root fields every time -- so we skip
    //    the write here by comparing names?
    if (!name.isEmpty()) {
      if (Comparing.equal(name, vfsPeer.getName(rootId), caseSensitive)) {
        // TODO RC: what if name doesn't change -- but root _attributes_ do? Handle this case also
        return -1;
      }
    }
    else {
      if (areChildrenLoaded(rootId)) {
        return -1; // TODO: hack
      }
    }

    return vfsPeer.updateRecordFields(rootId, FSRecords.NULL_FILE_ID, attributes, name, /* cleanAttributeRef: */ false);
  }
private int writeRootFields(int rootId,
                              @NotNull String name,
                              boolean caseSensitive,
                              @NotNull FileAttributes attributes)