<commit_before>package railo.commons.util.mod;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

import railo.runtime.exp.PageException;


public class SyncMap<K,V>
        implements MapPro<K,V>, Serializable {
        private static final long serialVersionUID = 1978198479659022715L;

        private final MapPro<K,V> m;     // Backing Map
        final Object      mutex;        // Object on which to synchronize

        public SyncMap(MapPro<K,V> m) {
            if (m==null)
                throw new NullPointerException();
            this.m = m;
            mutex = this;
        }

        SyncMap(MapPro<K,V> m, Object mutex) {
            this.m = m;
            this.mutex = mutex;
        }

        public int size() {
            synchronized (mutex) {return m.size();}
        }
        public boolean isEmpty() {
            synchronized (mutex) {return m.isEmpty();}
        }
        public boolean containsKey(Object key) {
            synchronized (mutex) {return m.containsKey(key);}
        }
        public boolean containsValue(Object value) {
            synchronized (mutex) {return m.containsValue(value);}
        }
        public V get(Object key) {
            synchronized (mutex) {return m.get(key);}<commit_msg>add support for empty constructor<commit_after>package railo.commons.util.mod;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Set;

import railo.runtime.exp.PageException;


public class SyncMap<K,V>
        implements MapPro<K,V>, Serializable {
        private static final long serialVersionUID = 1978198479659022715L;

        private final MapPro<K,V> m;     // Backing Map
        final Object      mutex;        // Object on which to synchronize

        public SyncMap() {
            this(null);
        }
        
        public SyncMap(MapPro<K,V> m) {
            if (m==null) this.m = new HashMapPro<K, V>();
            else this.m = m;
            mutex = this;
        }

        SyncMap(MapPro<K,V> m, Object mutex) {
            this.m = m;
            this.mutex = mutex;
        }
        
        public MapPro<K, V> getMap(){
        	return m;
        }

        public int size() {
            synchronized (mutex) {return m.size();}
        }
        public boolean isEmpty() {
            synchronized (mutex) {return m.isEmpty();}
        }
        public boolean containsKey(Object key) {
            synchronized (mutex) {return m.containsKey(key);}
        }
        public boolean containsValue(Object value) {
            synchronized (mutex) {return m.containsValue(value);}
        }
        public V get(Object key) {
            synchronized (mutex) {return m.get(key);}
{'fraction_non_alphanumeric': 0.10395010395010396, 'fraction_numerical': 0.013167013167013167, 'mean_word_length': 1.9824380165289257, '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': '3749007', 'n_tokens_mistral': 856, 'n_tokens_neox': 833, 'n_words': 214}