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 TrackerStatus/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: