tracker issue : CF-4202595

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

StructFindKey path is returned as associative array rather than a period delimited list

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Justin Treher / ()

Created: 05/23/2018

Components: Functions

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal /

Locale/System: / Windows 10

Vote Count: 0

Problem Description:
StructFindKey() appears to get confused with strings that can be cast to double. For instance, this one has an "R" towards the end. This has the appearance of the old serialization issues with scientific notation serialization issues where strings that _could_ be converted to double would be. You can change the key to be any other numeric value and it happens as well.

CF10, CF11, Lucee all have a dot delimited path returned. CF2016/2018 do not.

Steps to Reproduce:

xyz = {};
xyz["959840420R24"] = {};
xyz["959840420R24"]["102"] = 1;

writeDump(structFindKey(xyz, "102", "all"));

Actual Result:
["959840420R24"]["102"] <- Associative Array
Expected Result:
Any Workarounds:



This change was made as a part of fix for the bug , [] StructFindKey will return dotted notation , if the key is a valid identifier . Otherwise will return  Associative Array. "All identifiers must begin with a letter, an underscore, or a Unicode currency character. Any other symbol, such as a number, is not valid. " Hence this is not a bug.
Comment by Suchika Singh
29835 | October 24, 2018 09:48:37 AM GMT