tracker issue : CF-3724983

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

java.lang.Double cannot be cast to java.lang.String

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Jim Briggs / Jim Briggs (SirJames)

Created: 03/17/2014

Components: General Server

Versions: 10.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: Final / 290459

Priority/Frequency: Major / All users will encounter

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

Vote Count: 0

Listed in the version 11.0.03.292480 Issues Fixed doc
Problem Description: java.lang.Double cannot be cast to java.lang.String  occurs in cftextarea and cfselect when setting a value using cfset and adding +1 to it. This has also been tested in CF9 and it also breaks there. It worked in CF7.

Steps to Reproduce: The following simple form will have the last element crash. 
<Cfset CurrentID = 10>
<cfform name="test" >
<cftry>
	<cfoutput>
	<table>
		<tr valign="top">
			<Td align="center" nowrap>
				<!--- JBB - 03/17/2014 - 08:29 - this works because the cfset below causes the type change --->
				incoming: #CurrentID#
				<cftextarea  onfocus="lastFocus=this" id="#currentID#" cols="110" rows="3" name="Purpose" required="Yes" message="You must enter a purpose.">ddd</cftextarea> 
				<cfset CurrentID = CurrentID + 1>
				outgoing: #currentID#
			</TD>
		</tr>
		<tr valign="top">
			<Td  align="center" nowrap>
				<!--- JBB - 03/17/2014 - 08:30 - this works because it's a normal text area --->
				incoming: #CurrentID#
				<textarea  onfocus="lastFocus=this" id="#currentID#" cols="110" rows="3" name="Purpose" required="Yes" message="You must enter a purpose.">ddd</textarea>
				<cfset CurrentID = CurrentID + 1>#CurrentID#
				outgoing: #currentID#
			</TD>
		</tr>
		<tr valign="top">
			<Td align="center" nowrap>
				<!--- JBB - 03/17/2014 - 08:30 - this works because of the space in the id field --->
				incoming: #CurrentID#
				<cftextarea  onfocus="lastFocus=this" id="#currentID# " cols="110" rows="3" name="Purpose" >ddd</cftextarea>
				<cfset CurrentID = CurrentID + 1>#CurrentID#
				outgoing: #currentID#
			</TD>
		</tr>
		<tr valign="top">
			<Td align="center" nowrap>
				<!--- JBB - 03/17/2014 - 08:30 - this breaks because the space in the id field has been removed --->
				incoming: #CurrentID#
				<cftextarea  onfocus="lastFocus=this" id="#currentID#" cols="110" rows="3" name="Purpose" >ddd</cftextarea>
				<cfset CurrentID = CurrentID + 1>
				outgoing: #currentID#
			</TD>
		</tr>		
	</table>
</cfoutput>
<cfcatch><cfdump var="#CFCatch#"></cfcatch>
</cftry>	
</cfform>

Actual Result: If the cftry above is taken out a 500 error occurs.

Expected Result: The id field value should be incrementing normally.

Any Workarounds: Instead of using "#currentid#" in the id field use "#currentid# " (add a space so it evaluates as a string.

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

Watson Bug ID:	3724983

External Customer Info:
External Company:  
External Customer Name: SirJames
External Customer Email:  
External Test Config: My Hardware and Environment details: Windows Server 2008r2. Is a brand new install with up to update 13 applied.

Attachments:

Comments:

Verified this is fixed in CF11 Update 3. The following no longer throws an error: Code 1: <cfform><cftextarea name="#1+1#" id="#1+1#" value="#1+1#" /></cfform> Result 1: <textarea name="2" id="2.0" >2</textarea> Question: Why the id="2.0"? Especially since the following outputs id="2": Code 2: <cfform><cftextarea name="#1+1#" value="#1+1#" /></cfform> Result 2: <textarea name="2" id="2" >2</textarea> Thanks!, -Aaron
Comment by External U.
13066 | November 06, 2014 09:54:27 AM GMT
That is because the way we store the id and name are different. You can log a bug for this and it will most probably be fixed in a major release.
Comment by Himavanth R.
13067 | November 10, 2014 05:33:01 AM GMT
Hi Himavanth, Thanks very much for that clarification. I've logged it as #CF-3849712. Thanks!, -Aaron
Comment by External U.
13068 | November 10, 2014 08:25:17 PM GMT