/** * registers a std set of fast cloners. */ protected void registerFastCloners() { fastCloners.put(GregorianCalendar.class, new FastClonerCalendar()); fastCloners.put(ArrayList.class, new FastClonerArrayList()); fastCloners.put(LinkedList.class, new FastClonerLinkedList()); fastCloners.put(HashSet.class, new FastClonerHashSet()); fastCloners.put(HashMap.class, new FastClonerHashMap()); fastCloners.put(TreeMap.class, new FastClonerTreeMap()); fastCloners.put(LinkedHashMap.class, new FastClonerLinkedHashMap()); fastCloners.put(ConcurrentHashMap.class, new FastClonerConcurrentHashMap()); fastCloners.put(ConcurrentLinkedQueue.class, new FastClonerConcurrentLinkedQueue()); // register private classes FastClonerArrayListSubList subListCloner = new FastClonerArrayListSubList(); registerInaccessibleClassToBeFastCloned("java.util.ArrayList$SubList", subListCloner); registerInaccessibleClassToBeFastCloned("java.util.SubList", subListCloner); registerInaccessibleClassToBeFastCloned("java.util.RandomAccessSubList", subListCloner); }
/** * registers a std set of fast cloners. */ protected void registerFastCloners() { fastCloners.put(GregorianCalendar.class, new FastClonerCalendar()); fastCloners.put(ArrayList.class, new FastClonerArrayList()); fastCloners.put(LinkedList.class, new FastClonerLinkedList()); fastCloners.put(HashSet.class, new FastClonerHashSet()); fastCloners.put(HashMap.class, new FastClonerHashMap()); fastCloners.put(TreeMap.class, new FastClonerTreeMap()); fastCloners.put(LinkedHashMap.class, new FastClonerLinkedHashMap()); fastCloners.put(ConcurrentHashMap.class, new FastClonerConcurrentHashMap()); fastCloners.put(ConcurrentLinkedQueue.class, new FastClonerConcurrentLinkedQueue()); // register private classes FastClonerArrayListSubList subListCloner = new FastClonerArrayListSubList(); registerInaccessibleClassToBeFastCloned("java.util.ArrayList$SubList", subListCloner); registerInaccessibleClassToBeFastCloned("java.util.SubList", subListCloner); registerInaccessibleClassToBeFastCloned("java.util.RandomAccessSubList", subListCloner); }