Keith,
I did modify the source generator to produce deep clone() method as you
pointed out. However in the process I realized that when handling
ArrayLists there is no easy way to call clone() on the elements inside.
What I get is Object. Casting it to Clonable does not help because
Cloneable does not unprotect it. this means I have to use reflection to
get clone() method, try to call it and catch IllegalAccessException (in
which I'll do a set(value) instead of calling a clone with assumtpiton
that it is an immutable object like String). I think this is overly
complex and expensive (reflection, exception handling) so I might as
well just serialize and de-serialize the object in some stream to get a
cloned copy.
what do you think?
- Ilya
> >
> > > Nice to see your still alive. We don't support it by
> default, but you
> > > can modify the SourceFactory.java to add this support.
> >
> > That's what I thought, I just wanted to make sure that it
> is not already
> > there as part of some hidden switch. If I do this wouldn't
> it make sense
> > to add it to source generator as an option, or you don't think there
> > would be enough interest in this feature? I'll probably do
> it anyway
>
> Just send me a diff -u and I will apply the patch. By default the
> cloneable
> shouldn't be generated, but I don't mind having a switch which enables
> it.
>
> Thanks,
>
> --Keith
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev