private static void checkNewRecordIsZero(PersistentFSRecordsStorage records,
                                           int newRecordId) throws IOException {
    int parentId = records.getParent(newRecordId);
    int nameId = records.getNameId(newRecordId);
    int contentId = records.getContentRecordId(newRecordId);
    int attributeRecordId = records.getAttributeRecordId(newRecordId);
    int flags = records.getFlags(newRecordId);
    int modCount = records.getModCount(newRecordId);
    long length = records.getLength(newRecordId);
    long timestamp = records.getTimestamp(newRecordId);
    if (parentId != NULL_FILE_ID || nameId != NULL_NAME_ID || contentId != NULL_ID || attributeRecordId != NULL_ID ||
        flags != 0 || modCount != 0 || length != 0 || timestamp != 0) {

      IOException exception = new IOException(
        "new record (id: " + newRecordId + ") has non-empty fields: " +
        "parentId=" + parentId + ", flags=" + flags + ", nameId= " + nameId + ", " +
        "attributeId=" + attributeRecordId + ", contentId=" + contentId + ", " +
        "length=" + length + ", timestamp=" + timestamp + ", " +
        "modCount=" + modCount + " (globalModCount: " + records.getGlobalModCount() + "), " +
        "wasClosedProperly=" + records.wasClosedProperly()
      );

      FSRecords.LOG.error(exception);

      //try fixing the error: clean the record (modCount can't be cleaned, ok, let it be off)
      records.fillRecord(newRecordId, 0, 0, 0, 0, 0, true);
      records.setContentRecordId(newRecordId, 0);
    }
  }
private static void checkNewRecordIsZero(PersistentFSRecordsStorage records,
                                           int newRecordId)