tracker issue : CF-4149367

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

Metadata of a struct is not set for the duplicate of the struct.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): / ext-user (Suchika Singh)

Created: 05/06/2016

Components: Language, Datastructure

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: 2016.0.2.298738 /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Linux All,Mac 10 All,Solaris All,Win XP All

Vote Count: 0

Listed in the version 2016.0.02.299200 Issues Fixed doc
Problem:
Metadata of a struct is not set for the duplicate of the struct.
Method:
<cfscript>
name=[fname='Tom',Lname='Yes'];
name.setmetadata({lname:'string'});
dup_struct=duplicate(name);
writeoutput(#SerializeJson(dup_struct.getmetadata())#);
writeoutput(#SerializeJson(name.getmetadata())#);
  writeoutput('Serialized Struct: ' & #SerializeJson(dup_struct)#);
</cfscript>

Result:
{"ordered":"insertion"} {"ordered":"insertion","keys":{"LNAME":"string"}} Serialized Struct: {"FNAME":"Tom","LNAME":true}

Expected:
 {"ordered":"insertion","keys":{"LNAME":"string"}} {"ordered":"insertion","keys":{"LNAME":"string"}}  Serialized Struct: {"FNAME":"Tom","LNAME":"yes"}

Workaround:

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

Watson Bug ID:	4149367

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

Attachments:

Comments:

test note
Comment by CFwatson U.
2930 | June 07, 2016 04:17:10 AM GMT
The fix for this bug is available as part of the early-access build for ColdFusion 2016 Update 2.
Comment by CFwatson U.
2931 | June 07, 2016 04:23:52 AM GMT