tracker issue : CF-4203134

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

Interface checks are now runtime and not at CFC creation, breaking TestBox

| View in Tracker

Status/Resolution/Reason: To Fix//Investigate

Reporter/Name(from Bugbase): Bradley Wood / ()

Created: 07/24/2018

Components: Language

Versions: 13.0

Failure Type: Others

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / Most users will encounter

Locale/System: / Platforms All

Vote Count: 1

Interfaces have always been checked at the time of the CFC creation, but 2018 appears to have a new runtime check which is causing a lot of issues.  Frameworks like TestBox create runtime method stubs to allow for mocking of method signatures.  This was never an issue before, but now this error is thrown when attempting to call a method that is a runtime mock created by MockBox:

The XYZ function does not specify the same arguments or arguments in the same order in the com.foo.bar ColdFusion component and the com.foo.IBar ColdFusion interface.

You can see several instances of this error if you start up a 2018 server and run the ColdBox unit test suite.  Is there a reason this has been moved to a runtime check and what is the performance overhead of checking method signatures on invocation?

Attachments:

Comments:

Hi Brad, We have made changes in Interface checks because of the feature "Default Functions in Interfaces" that was introduced in CF 2018 . Please give us a simple repro case .We will check  at our end to see if it can be fixed or not. Thanks, Suchika    
Comment by Suchika Singh
29398 | July 25, 2018 09:58:11 AM GMT
Hi Suchika, This is possibly related to?: https://coldfusion.adobe.com/2018/06/runtime-interface-fulfillment-check/ That's Adam's unanswered PR question that I duplicated into the Portal. If the behavior Adam and Brad see is new in Aether, then I agree backward-compat should be restored if at all possible. It was definitely reported in time for it to be discussed pre-GM. Thanks!, -Aaron
Comment by Aaron Neff
29414 | July 31, 2018 07:14:33 AM GMT
+1 ...........
Vote by Aaron Neff
29415 | July 31, 2018 07:17:57 AM GMT
Hi Suchika, I didn't notified of your comment. Thanks for pinging me Aaron. I'm traveling at the moment, but you can see this easily if you run the ColdBox unit test suite, which I would recommend the CF team make a regular part of your tests. I would also vote for the removal of default method implementation on interfaces as it was never asked for (so far as I know) and doesn't make sense in a dynamic language like CFML anyway. It's just cruft that's caused other regressions.
Comment by Bradley Wood
29416 | July 31, 2018 05:17:43 PM GMT
Hi Brad, Please provide us a simplified test case to reproduce the issue you are seeing.   Thanks. Vijay
Comment by Vijay Mohan
29594 | August 22, 2018 11:50:38 AM GMT