void (final AttributeRecord[] updatedRecords) { //attribute record id (directory record) could be changed (record relocated) because of later // appended attributes. Here we scan all attribute records, and ensure all records with the same // fileId have the same attributeRecordId -- most recent one, stored in fileIdToAttributeRecordId // mapping for (int i = 0; i < updatedRecords.length; i++) { final AttributeRecord updatedRecord = updatedRecords[i]; final int mostRecentAttributeRecordId = fileIdToAttributeRecordId.get(updatedRecord.fileId); if (updatedRecord.attributesRecordId != mostRecentAttributeRecordId) { updatedRecords[i] = updatedRecord.withAttributesRecordId(mostRecentAttributeRecordId); } } }