<commit_before>package org.arp.javautil.datastore;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import com.sleepycat.bind.EntryBinding;
import com.sleepycat.bind.serial.ClassCatalog;
import com.sleepycat.bind.serial.SerialBinding;
import com.sleepycat.collections.StoredMap;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseException;

abstract class BdbMap<K, V> implements DataStore<K, V> {
    private final Database db;
    private final StoredMap<K,V> storedMap;

    BdbMap(String dbName) throws DatabaseError {
        try {
            this.db = getDatabase(dbName);

            ClassCatalog catalog = createOrGetClassCatalog();
            EntryBinding<K> kBinding = new SerialBinding<K>(catalog, null);
            EntryBinding<V> vBinding = new SerialBinding<V>(catalog, null);
            storedMap = new StoredMap<K, V>(db, kBinding, vBinding, true);
        } catch (DatabaseException ex) {
            throw new DataStoreError(ex);
        }
    }<commit_msg>replaced throwing of deprecated DatabaseError with DataStoreError in constructor<commit_after>package org.arp.javautil.datastore;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

import com.sleepycat.bind.EntryBinding;
import com.sleepycat.bind.serial.ClassCatalog;
import com.sleepycat.bind.serial.SerialBinding;
import com.sleepycat.collections.StoredMap;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseException;

abstract class BdbMap<K, V> implements DataStore<K, V> {
    private final Database db;
    private final StoredMap<K,V> storedMap;

    BdbMap(String dbName) throws DataStoreError {
        try {
            this.db = getDatabase(dbName);

            ClassCatalog catalog = createOrGetClassCatalog();
            EntryBinding<K> kBinding = new SerialBinding<K>(catalog, null);
            EntryBinding<V> vBinding = new SerialBinding<V>(catalog, null);
            storedMap = new StoredMap<K, V>(db, kBinding, vBinding, true);
        } catch (DatabaseException ex) {
            throw new DataStoreError(ex);
        }
    }
{'fraction_non_alphanumeric': 0.09848484848484848, 'fraction_numerical': 0.0, 'mean_word_length': 3.58351409978308, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '6738570', 'n_tokens_mistral': 630, 'n_tokens_neox': 630, 'n_words': 144}