tracker issue : CF-3988223

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

Implicit array within function call and other requirements produces java.lang.ClassCastException

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Chris Hopkins / Chris Hopkins (Chris Hopkins)

Created: 05/14/2015

Components: Language

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / Few users will encounter

Locale/System: ALL / Win 2008 Server R2 64 bit

Vote Count: 1

Listed in the version 2016.0.03.300466 Issues Fixed doc
Problem Description:

Ok stupidly odd one this.

a query cfloop next to a directly outputed function call with an array litteral as an argument that is within a cfoutput makes CF11 die.


Steps to Reproduce:

<!--- random test query - original was from a database --->
<cfset test_query = queryNew('a,b') />

<!--- a random function that takes an array --->
<cffunction name="getCustomSelectField">
	<cfargument name="array" type="array" />
	<cfreturn "it worked" />
</cffunction>

<cfoutput>
	<!--- what we do here seems not to matter just that the cfloop exists is enough of an issue --->
	<cfloop query="test_query">

	</cfloop>
 
       <!--- the main issue here is the array litteral as an argument and that we are directly outputing the result --->
	#getCustomSelectField(
		array = []
	)#

</cfoutput>

Actual Result:

Error casting an object of type to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed. 

java.lang.ClassCastException

Expected Result:

it worked 

Any Workarounds:

LOADS - dont use a litteral. Store the littleral or function result in a variable, use two seperate cfoutputs.... the list goes on its very specifc but pops up randomly and is Very annoying.

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

Watson Bug ID:	3988223

External Customer Info:
External Company:  
External Customer Name: Chris
External Customer Email:  
External Test Config: My Hardware and Environment details: CF11 - win 7 / Win server 2012  - IIS 7.5

Attachments:

Comments:

Title should be ammended to 'Array Litteral' and not 'Implicit Array' - late in the day and the brain is slowing down
Comment by External U.
7436 | May 14, 2015 11:00:15 AM GMT
Verified the fix on #299233. Added test case at //depot/qa/cf/regression/coretests/coldfusion/functions/array/Bugs/CF-3988223.cfm
Comment by HariKrishna K.
7437 | June 15, 2016 02:33:38 AM GMT
Awesome, presume this has been released now, what hotfix was this fixed in?
Comment by Chris H.
7438 | April 06, 2017 01:27:24 PM GMT
This fix was released in Update 3 for ColdFusion 2016
Comment by Vamseekrishna N.
7439 | April 07, 2017 05:22:18 AM GMT
Any plans on fixing it for CF11 where it was found?
Comment by Chris H.
7440 | April 07, 2017 08:48:45 AM GMT
Yeah that's not really good enough, Vamseekrishna Nanneboina. You need to *at least* fix these things in the version in which they are found. And ideally in all currently supported versions. But *in the version they were found in* needs to be the priority.
Comment by Adam C.
7441 | April 11, 2017 03:49:12 PM GMT
@Chris, we will backport this fix to 11.0 as well. in case you need an urgent fix for this, drop me an email at vmannebo@adobe.com.
Comment by Vamseekrishna N.
7442 | April 12, 2017 08:24:34 AM GMT
I ran into this same issue yesterday on CF11 and checked the CF update 12 and 13 bug lists and this fix does not appear to have been implemented in CF11 yet. I used the separate cfoutput's workaround and added </cfoutput><cfoutput> above my cfloop to eliminate the error.
Comment by GEORGE A.
7443 | February 20, 2018 01:42:31 PM GMT