List of usage examples for java.lang Cloneable getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:com.qrmedia.commons.persistence.hibernate.clone.property.CloneablePropertyCloner.java
private static Cloneable clone(Cloneable cloneable) throws IllegalArgumentException { /*/*from w w w . j av a2s . c om*/ * Assumes - in spite of the detailed warnings in the documentation * for Clonable - that the cloneable *will* have a public clone() method, * as per convention. */ try { return (Cloneable) cloneable.getClass().getMethod("clone", (Class[]) null).invoke(cloneable, (Object[]) null); } catch (Exception exception) { throw new IllegalArgumentException("Unable to clone " + cloneable + " due to " + exception.getClass().getSimpleName() + ": " + exception.getMessage()); } }