@Deprecated public class ObjectUtil extends Object
Binary-compatibility facade for class files compiled by Groovy 4.0.5+ (GROOVY-12257).
The @Immutable transform in Groovy 4.0.5 through 4.0.x emitted
INVOKESTATIC calls to cloneObject(Object) into generated
constructors and getters for defensive copies (GROOVY-10747). The original
class was removed together with the $getLookup machinery it relied
on (GROOVY-10931), which broke such pre-compiled classes with a
NoClassDefFoundError at first instantiation. This facade restores
the call target with equivalent behaviour, minus the lookup dependency:
arrays are cloned via ArrayUtil exactly as before, and other
Cloneables through their public clone() via the MOP.
Nothing compiled by Groovy 5+ references this class; its transforms emit
invokedynamic-based or InvokerHelper clone calls instead.
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
public static T |
cloneObject(T object)Clone the specified object |
Clone the specified object
object - the object to cloneT - the object type