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: Closed/Fixed/Fixed

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

Created: 07/24/2018

Components: Language

Versions: 2018

Failure Type: Others

Found In Build/Fixed In Build: Final / 2018.0.0.311644

Priority/Frequency: Normal / Most users will encounter

Locale/System: / Platforms All

Vote Count: 6

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 S.
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 N.
29414 | July 31, 2018 07:14:33 AM GMT
+1 ...........
Vote by Aaron N.
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 W.
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 M.
29594 | August 22, 2018 11:50:38 AM GMT
+1 Please resolve this, or at the very least liaise with the *box team on this. Testbox is the de-facto way to unit test ACF applications, if our test suite is not green under ACF2018, we will not upgrade to ACF2018. Interested to know what the internal testsuite at Adobe uses and if there was a test for this.
Vote by John W.
29766 | October 08, 2018 07:48:53 AM GMT
+1
Vote by Jim P.
29769 | October 09, 2018 02:18:19 PM GMT
Hi Brad,   Please provide us a simplified test case to reproduce the issue.   Thanks. Vijay
Comment by Vijay M.
29768 | October 09, 2018 04:42:50 PM GMT
When interfaces were introduced, you insisted on NOT doing runtime checks for performance reasons. Now you've added a Java feature that no one asked for and added runtime checking and broken a widely used framework.
Vote by Sean C.
29776 | October 09, 2018 08:50:16 PM GMT
Seems my comment from yesterday is no longer here. Posting this again,. There is a standalone repro case in this repo which errors on CF2018 but not CF11 or 2016. https://github.com/bdw429s/CF-4203134/
Comment by Bradley W.
29780 | October 10, 2018 09:20:55 PM GMT
+1
Vote by Sid W.
30153 | January 28, 2019 07:11:37 PM GMT