Proper Implementation of clone() For Domain Classes to duplicate a Grails domain instance
问题 I have several domain classes for which the user interface includes a "duplicate" command. As part of the implementation of those commands, I have implemented clone() methods in the corresponding domain classes. I have been trying to correct my bad habit of improperly implementing clone() (in general) based on use of " new " rather than "super.clone()," so as soon as I thought about doing the same for my Grails domain classes, I wondered how using super.clone() to obtain a clone might