tracker issue : CF-4200881

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

ArrayResize doesn't support unsynchronized arrays

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Matthieu Labarre / Matthieu Labarre ()

Created: 01/25/2018

Components: Language, Functions

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016,0,05,303689 / 2018,0,0,307104

Priority/Frequency: Normal / Few users will encounter

Locale/System: / CentOS 7.3

Vote Count: 4

Problem Description:
The function ArrayResize (and its counterpart .resize() ) can't be applied to an unsynchronised array.
Steps to Reproduce:
Execute the following script:

{code:java}
<cfscript>
 myArray = ArrayNew(1, false);
 ArrayResize(myArray, 1000);
 // or myArray.resize(1000);
 myArraySize = ArrayLen(myArray);
 writeOutput(myArraySize);
</cfscript>
{code}

Actual Result:
An error is thrown at "ArrayResize(myArray, 1000)" : 
"coldfusion.runtime.FastArray cannot be cast to coldfusion.runtime.Array on line 3"
Expected Result:
No error thrown; "1000" is displayed

Attachments:

Comments:

This has NOT been fixed in CF2016.
Vote by scott r.
30879 | June 04, 2019 02:55:06 PM GMT
This has NOT been fixed in CF2016, despite being reported against that version.
Comment by scott r.
30877 | June 04, 2019 02:56:19 PM GMT
This should be fixed in CF2016 too.
Comment by Carl V.
30878 | June 04, 2019 03:26:44 PM GMT
Nope, not fixed in 2016, currently causing me a headache.
Vote by James P.
30880 | June 04, 2019 04:20:21 PM GMT