tracker issue : CF-3194160

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

cfdump of an array with an undefined element throws an exception

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Bill Moniz / Bill Moniz (BillMoniz)

Created: 05/20/2012

Components: Core Runtime

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: 9.0.1 / 286214, 288539

Priority/Frequency: Minor / Some users will encounter

Locale/System: English / Windows 7

Vote Count: 0

Problem Description:
If an array is created without an initial size, then data is added to an index greater than 1, a cfdump of the array with throw an exception.

Steps to Reproduce:
Run this sample code -

<cfset testArray = []>
<cfset testArray[2] = "something">
<cfdump var="#testArray#">

Actual Result:
The dump shows "[undefined array element] Element 1 is undefined in a Java object of type class coldfusion.runtime.Array." at the first array index.  Also, request debugging information shows " Element 1 is undefined in a Java object of type class coldfusion.runtime.Array."

Expected Result: Position one should just say "Undefined" or similar.  An exception if trying to access that index would make sense.  In other words, I expect <cfset newVar = testArray[1]> to fail, but the dump should not.  Attached screenshot of how Railo handles it.

Any Workarounds:

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

Watson Bug ID:	3194160

External Customer Info:
External Company:  
External Customer Name: BillMoniz
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Reporter says array value shouldn't contain exception message and he just needs some value such as "undefined" if the particular index of an array in undefined.. But the below code still has a error message as it's value !! <cfset testArray = []> <cfset testArray[2] = "something"> <cfdump var="#testArray[2]#"> (Comment added from ex-user id:yrr)
Comment by Adobe D.
19376 | February 11, 2014 05:40:26 AM GMT
I don't see an error produced by the sample code Yashas R R posted, It returns "something" as expected. The original problem this bug describes still exists in version 10,0,13,287689.
Comment by External U.
19377 | February 11, 2014 03:56:35 PM GMT