Title:
In CF11 (not 9) , structKeyExists() returns false when cfdump shows true. Which is it?
| View in TrackerStatus/Resolution/Reason: Closed/Won't Fix/
Reporter/Name(from Bugbase): Stephen Johnson / Stephen Johnson (Stephen Johnson)
Created: 05/22/2015
Components: Language
Versions: 11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Normal / All users will encounter
Locale/System: English / Win 2012 Server x64
Vote Count: 3
Problem Description: In CF11 and, I suspect, CF10, structKeyExists() returns false for a structkey generated via the deserializeJSON() function. CFDUMP, on the other, shows the key. The behavior occurs on structkeys where the corresponding value is null.
In bug fix 3043777, a bug fix corrected a problem where null values where incorrectly replaced with the string 'null' or so I interpret. Bug 3505249 also references this issue. While I agree that null going to 'null' was the wrong behavior there now seems to be the above side effect in CF11.
Steps to Reproduce:
I've attached the sandbox code. Please run in CF9 and CF11. Results will differ.
Actual Result:
StructKeys returned from deserializeJSON() with null values are not picked up as existing when structKeyExists() is applied to the resulting struct. CFDUMP, on the other hand, shows the key.
Expected Result:
In the example I provided, it depends on whether the deserialized JSON key truly is a key. Regardless of null being the value, I think it is. In any case, there needs to be consistency between CFDUMP and structKeyExists(). Right now there is not.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3993581
External Customer Info:
External Company:
External Customer Name: Stephen
External Customer Email:
External Test Config: My Hardware and Environment details:
Server Details
Server Product ColdFusion
Version 11,0,03,292480
Edition Developer
Operating System Windows Server 2012
OS Version 6.2
Adobe Driver Version 5.1.3 (Build 000094)
Attachments:
- May 23, 2015 00:00:00: 1_DeserializeJSONCF11.cfm
Comments: