Status/Resolution/Reason: Closed/Withdrawn/Duplicate
Reporter/Name(from Bugbase): Ian Clark / Ian Clark (Ian Clark)
Created: 05/13/2016
Components: Language, Functions
Versions: 2016
Failure Type: Crash
Found In Build/Fixed In Build: CF2016_Final /
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Windows 10 64 bit
Vote Count: 0
Duplicate ID: CF-4126411
Problem Description:I have a custom tag that creates a soundex value of a persons name. This tag has this code:
<CFIF IsDefined("attributes.stringtosoundex")>
<CFSCRIPT>
stringtoconvert = ucase(attributes.stringtosoundex);
stclength = len(stringtoconvert);
leader = left(stringtoconvert, 1);
leadervalue = leader;
body = right(stringtoconvert, stclength - 1);
body = replacelist(body, "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z", "0,1,2,3,0,1,2,0,0,2,2,4,5,5,0,1,2,6,2,3,0,1,0,2,0,2");
leadervalue = replacelist(leadervalue, "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z", "0,1,2,3,0,1,2,0,0,2,2,4,5,5,0,1,2,6,2,3,0,1,0,2,0,2");
</CFSCRIPT>
<CFLOOP INDEX="counter" from="1" to="9">
<CFSET DOUBLE = counter * 11>
<CFSET BODY = replace(BODY, double, counter, "ALL")>
</CFLOOP>
The CFSET Body fails with a java.lang.Double cannot be cast to java.lang.String error message (this code was developed around 2000 and has been working as is for 16 years.
Steps to Reproduce:
Create a test page with:
<cfset body="Any String12321">
<cfset str1=2>
<cfset str2=4>
<cfset BODY=replace(Body,Str1,Str2,"ALL")>
Actual Result:
Java error
Expected Result:
replace occurs.
Any Workarounds: yes. Need to add ToString() to both numbers.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4152769
External Customer Info:
External Company:
External Customer Name: Ian Clark
External Customer Email:
External Test Config: My Hardware and Environment details: Windows 10
Attachments:
- May 13, 2016 00:00:00: 1_soundex.cfm
Comments: