tracker issue : CF-3738100

select a category, or use search below
(searches all categories and all time range)
Title:

CFCLIENT: datastructures : struct : duplicate : Get duplicate of struct. Changing the value of referenced struct of its nested struct does not change value of its other nested struct when both nested structs refer to the same struct

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / ext-user (Anuj Nawani)

Created: 04/07/2014

Components: Mobile Support, Data Structure

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: 289635 /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Listed in the version 11.0.03.292480 Issues Fixed doc
Code snippet:

<div id="actual_1" class="actual">
<cfclient>
<cfscript>
stAddressInner = structNew();
stAddressInner.country = "India";

stEmployee = structNew();
stEmployee.residenceAddress = stAddressInner;  // pointer to stAddressInner
stEmployee.officeAddress = stAddressInner;  // also a pointer to stAddressInner. So point to same data.

dupStruct = duplicate(stEmployee);
</cfscript>

<cfscript>
dupStruct.residenceAddress.country = "UK";
</cfscript>

<cfoutput>
#dupStruct.officeAddress.country#
</cfoutput>
</cfclient>
</div>

Expected: UK
Actual: India

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3738100

External Customer Info:
External Company:  
External Customer Name:  
External Customer Email:

Attachments:

Comments:

Hi Anuj, I've verified this is fixed in CF11 Update 3 (11,0,03,292024(PreRelease)). Thanks!, -Aaron
Comment by External U.
12822 | November 15, 2014 07:02:19 PM GMT