tracker issue : CF-3738552

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

CFCLIENT: structure: copy : get copy of struct(having array as element) through StructCopy and modifying the array in the copied struct is reflecting the array of copy struct

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

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

Created: 04/08/2014

Components: Mobile Support, Data Structure

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: 289685 / CF11 Update5

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 0

Code snippet:
<div id="actual_2" class="actual">
<cfclient>
<cfset c="#structNew()#">
<cfset d="#structNew()#">
<cfset aArg1="#arrayNew(1)#">
<cfset aArg1[1] = "Clapton ">
<cfloop index="y" from=1 to=3>
	<cfset c["key#y#"] = #aArg1#>
</cfloop>	
<cfset d = structCopy(c)>
<cfset aArg1[1] = "Bowie ">
<cfloop index="y" from=1 to=3>
<cfset c["key#y#"] = #aArg1#>
</cfloop>			
<cfoutput>#d.key1[1]# #d.key2[1]##d.key3[1]#</cfoutput> 
</cfclient>
</div>

Expected: Clapton Clapton Clapton
Actual: Bowie Bowie Bowie

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

Watson Bug ID:	3738552

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

Attachments:

Comments:

Issue is fixed, getting the expected output. Hence, closing this bug. (Comment added from ex-user id:prk)
Comment by Adobe D.
12809 | January 19, 2015 01:32:09 AM GMT
The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
12810 | February 20, 2015 09:27:49 AM GMT
Verified this is fixed in CF11 Update 5 (build 11,0,05,293506). Thanks!, -Aaron
Comment by External U.
12811 | November 23, 2015 09:40:20 PM GMT