commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Colebourne <>
Subject Re: [lang] CloneUtils
Date Tue, 07 Jun 2005 21:42:44 GMT
I like the idea of multiple methods with nice names. I'm not averse to a 
CloneUtils class (it could be argued that StringUtils is too big as one 
class, or that it is most convenient as one class...) Perhaps others can 
comment on the location of the new methods.


Kevin Gessner wrote:
> Kind of what I had in mind, but I'm not sure why serialization would
> be the last-attempted method.  It's guaranteed to work for any
> Serializable without mucking about with reflection, so it should
> probably go first.  We should also add support for Externalizables (as
> rare as they often are).  I hacked up some code based on Serialization
> cloning, which I could send along.
> I don't think this should nec'ly go in with ObjectUtils.  Each of the
> techniques of cloning would be its own method, with something like a
> cloneAll(Object o) that would try each in turn.  I think this would
> make ObjectUtils messy, and CloneUtils would tie it together nicely.
> Kevin
> On 6/6/05, Stephen Colebourne <> wrote:
>>OK, here is the definition of CloneUtils as originally in my mind:
>>See PrototypeFactory in [collections].
>>It clones an object by
>>a) public method named cloned (called by reflection)
>>b) public copy constructor
>>c) serialization
>>(trying each in turn until one suceeds)
>>IMHO, this would now be written as ObjectUtils.clone(Object).
>>(serialization is merely a means to an end, otherwise it would sit with

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message