MCPcopy Create free account
hub / github.com/davidgiven/luje / clone

Method clone

lib/java/util/HashMap.java:367–380  ·  view source on GitHub ↗

Returns a shallow copy of this map. @return a shallow copy of this map.

()

Source from the content-addressed store, hash-verified

365 * @return a shallow copy of this map.
366 */
367 @Override
368 @SuppressWarnings("unchecked")
369 public Object clone() {
370 try {
371 HashMap<K, V> map = (HashMap<K, V>) super.clone();
372 map.elementCount = 0;
373 map.elementData = newElementArray(elementData.length);
374 map.putAll(this);
375
376 return map;
377 } catch (CloneNotSupportedException e) {
378 return null;
379 }
380 }
381
382 /**
383 * Computes the threshold for rehashing

Callers 1

cloneMethod · 0.45

Calls 2

newElementArrayMethod · 0.95
putAllMethod · 0.65

Tested by

no test coverage detected