Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Brien Malone / Brien Malone (BrienMalone)
Created: 08/15/2014
Components: Core Runtime
Versions: 9.0.1
Failure Type: Incorrect w/Workaround
Found In Build/Fixed In Build: 9.0.1 / CF 11
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Win 2008 Server R2
Vote Count: 1
Problem Description: A 'perfect storm' of syntax in CF 9.0.1 can cause coldfusion to execute a function twice and ignore the line preceding the function call.
Steps to Reproduce:
Create a simple function that accepts a struct:
public void function SimpleFunction1 (struct incomingStruct) {
WriteOutput("This is SimpleFunction1.<BR />");
}
Call that function with a named, inline struct shortcut:
SimpleFunction1(incomingStruct={item1="ok",item2="go"});
Works fine so far. Now, wrap that function call in a try/catch block:
try{
SimpleFunction1(incomingStruct={item1="ok",item2="go"});
}
catch (any e){
rethrow;
}
Finally, add an instruction above the function call:
try{
abort; //this command will fail to execute
SimpleFunction1(incomingStruct={item1="ok",item2="go"});//this function call is executed twice
}
catch (any e){
rethrow;
}
Actual Result:
In spite of the abort, the following output will appear on screen:
This is SimpleFunction1.
This is SimpleFunction1.
Expected Result:
The function should execute once. The line preceding the function call should not be ignored.
Any Workarounds:
There are many:
* Don't use a named parameter, just pass in the struct shortcut.
OR
* Assign the struct to a variable and pass the variable in the function call.
OR
* Remove the try catch block
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3806526
External Customer Info:
External Company:
External Customer Name: BrienMalone
External Customer Email:
External Test Config: My Hardware and Environment details:
Server 2008 R2
ColdFusion Server Enterprise 9,0,1,274733
Attachments:
Comments: