Yes, this is a known bug. I don't recall the bug number. It's been
talked about for quite some time. However, if you look at how classes /
objects behave in Java and other languages, you wouldn't normally
expect a simple 'duplicate' function to do the right thing... that's
why you need to explicitly program how 'clone()' works in Java - the
semantics of duplicating an object are rarely the same as just
duplicating the 'struct' that represents it.
On Friday, Mar 14, 2003, at 16:20 US/Pacific, Brad Howerter wrote:
> When you duplicate an object it is converted from an object to a
> struct, and
> any private variables the object had are lost. The following code
> demonstrates the bug:
>
> <cfscript>
> oServer = createObject("component","wgc.common.serverObject");
> </cfscript>
>
> <cfdump var=#oServer# label="oServer">
> <cfset a = oServer>
> <cfdump var=#a# label="a">
> <cfset b = duplicate(a)>
> <cfdump var=#b# label="b">
>
> When b is dumped, the object is shown to be no longer an object, but a
> struct. Duplicate() does not duplicate the object.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4