<commit_before>package org.vertexium.accumulo;

import org.vertexium.*;

import java.util.*;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class LazyPropertyMetadata implements Metadata {
    private static final String KEY_SEPARATOR = "\u001f";
    private transient ReadWriteLock entriesLock = new ReentrantReadWriteLock();
    private final Map<String, Metadata.Entry> entries = new HashMap<>();
    private final List<MetadataEntry> metadataEntries;
    private int[] metadataIndexes;
    private final Set<String> removedEntries = new HashSet<>();
    private final long propertyTimestamp;
    private final VertexiumSerializer vertexiumSerializer;
    private final AccumuloNameSubstitutionStrategy nameSubstitutionStrategy;
    private final MetadataPlugin metadataPlugin;
    private final FetchHints fetchHints;

    public LazyPropertyMetadata(
        List<MetadataEntry> metadataEntries,
        int[] metadataIndexes,
        long propertyTimestamp,
        VertexiumSerializer vertexiumSerializer,
        AccumuloNameSubstitutionStrategy nameSubstitutionStrategy,
        MetadataPlugin metadataPlugin,
        FetchHints fetchHints
    ) {
        this.metadataEntries = metadataEntries;
        this.metadataIndexes = metadataIndexes;
        this.propertyTimestamp = propertyTimestamp;
        this.vertexiumSerializer = vertexiumSerializer;
        this.nameSubstitutionStrategy = nameSubstitutionStrategy;
        this.metadataPlugin = metadataPlugin;
        this.fetchHints = fetchHints;
    }<commit_msg>Fix a concurrent modification exception encountered when getting metadata values from lazy properties<commit_after>package org.vertexium.accumulo;

import org.vertexium.*;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class LazyPropertyMetadata implements Metadata {
    private static final String KEY_SEPARATOR = "\u001f";
    private transient ReadWriteLock entriesLock = new ReentrantReadWriteLock();
    private final Map<String, Metadata.Entry> entries = new ConcurrentHashMap<>();
    private final List<MetadataEntry> metadataEntries;
    private int[] metadataIndexes;
    private final Set<String> removedEntries = new HashSet<>();
    private final long propertyTimestamp;
    private final VertexiumSerializer vertexiumSerializer;
    private final AccumuloNameSubstitutionStrategy nameSubstitutionStrategy;
    private final MetadataPlugin metadataPlugin;
    private final FetchHints fetchHints;

    public LazyPropertyMetadata(
        List<MetadataEntry> metadataEntries,
        int[] metadataIndexes,
        long propertyTimestamp,
        VertexiumSerializer vertexiumSerializer,
        AccumuloNameSubstitutionStrategy nameSubstitutionStrategy,
        MetadataPlugin metadataPlugin,
        FetchHints fetchHints
    ) {
        this.metadataEntries = metadataEntries;
        this.metadataIndexes = metadataIndexes;
        this.propertyTimestamp = propertyTimestamp;
        this.vertexiumSerializer = vertexiumSerializer;
        this.nameSubstitutionStrategy = nameSubstitutionStrategy;
        this.metadataPlugin = metadataPlugin;
        this.fetchHints = fetchHints;
    }
{'fraction_non_alphanumeric': 0.05993407252022775, 'fraction_numerical': 0.0017980221756068325, 'mean_word_length': 4.298412698412698, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3753580', 'n_tokens_mistral': 818, 'n_tokens_neox': 785, 'n_words': 208}