diff --git a/src/com/sap/piper/MapUtils.groovy b/src/com/sap/piper/MapUtils.groovy index 5f8123b9a..d3cd32956 100644 --- a/src/com/sap/piper/MapUtils.groovy +++ b/src/com/sap/piper/MapUtils.groovy @@ -63,6 +63,13 @@ class MapUtils implements Serializable { m.putAll(updates) } + /* + * Provides a new map with the same content like the original map. + * Nested Collections and Maps are copied. Values with are not + * Collections/Maps are not copied/cloned. + * <paranoia>&/ltThe keys are also not copied/cloned, even if they are + * Maps or Collections;paranoia> + */ static deepCopy(Map original) { Map copy = [:] for (def e : original.entrySet()) { @@ -75,14 +82,14 @@ class MapUtils implements Serializable { copy } - static deepCopy(Set original) { + /* private */ static deepCopy(Set original) { Set copy = [] for(def e : original) copy << deepCopy(e) copy } - static deepCopy(List original) { + /* private */ static deepCopy(List original) { List copy = [] for(def e : original) copy << deepCopy(e) @@ -93,7 +100,7 @@ class MapUtils implements Serializable { * In fact not a copy, but a catch all for everything not matching * with the other signatures */ - static deepCopy(def original) { + /* private */ static deepCopy(def original) { original } }