Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Chris Phillips / Chris Phillips (cf_chris)
Created: 02/19/2013
Components: Language
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Final / 286287
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Windows 7 64-bit
Vote Count: 1
Problem Description:
If you cfloop over the expression #[1,2]# as the value of the "array" attribute and do an inner loop from 1 to 2, CF will throw the exception "The CFML compiler encountered an unexpected java.lang.ClassCastException exception...".
Steps to Reproduce:
<cfoutput>
<h2>cfloop over [1,2] (breaks)</h2>
<cfloop array="#[1,2]#" index="i">
<br>Outer: #i#
<cfloop from="1" to="2" index="ii">
<br> Inner: #ii#
</cfloop>
</cfloop>
</cfoutput>
Actual Result:
java.lang.ClassCastException: java.lang.Double cannot be cast to coldfusion.compiler.Node
at coldfusion.compiler.SemanticAnalyzer.transformLiteral(SemanticAnalyzer.java:888)
at coldfusion.compiler.SemanticAnalyzer.transform(SemanticAnalyzer.java:328)
at coldfusion.compiler.Treewalker.postorder(Treewalker.java:100)
Expected Result:
Outer: 1
Inner: 1
Inner: 2
Outer: 2
Inner: 1
Inner: 2
Any Workarounds:
Assign the array expression to a variable and use the variable as the value of the "array" attribute.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3502742
External Customer Info:
External Company:
External Customer Name: cf_chris
External Customer Email:
External Test Config: My Hardware and Environment details:
Windows 7
ColdFusion: 10,0,7,283649
Update Level: /I:/ColdFusion/InstanceDP1/lib/updates/chf10000007.jar
Attachments:
Comments: