tracker issue : CF-3040316

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

Bug 80395:(Watson Migration Closure)Interface with non-fully-qualified name is not implementable by CFC in a different folder

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)

Created: 10/16/2009

Components: Language, CF Interfaces

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 1

Problem:

Interface with non-fully-qualified name is not implementable by CFC in a different folder.
Method:

see \\10.192.26.224\c$\ColdFusion8\wwwroot\bugs\80395\*
create a folder called bugs in your webroot and copy folder 80395 into it
Run bug80395.cfm


// in \com\IHasUser.cfc:
interface {    
User function getUser();
}

// in com\user\User.cfc
component extends="com.IHasUser" {  
com.User function getUser();
}

Expected: should translate fully qualified type to satifiy interface, and User.cfc should have no error.

Actual: Error message: Return type mismatch.
Result:

Return type mismatch

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3040316

External Customer Info:
External Company:  
External Customer Name: Henry Ho
External Customer Email: 237A22C24921EDF5992015B9
External Test Config: 10/16/2009

Attachments:

Comments:

This occurs for me as well. E.g.: files laid out like so: {webroot}/{approot}/IConvertable.cfc {webroot}/{approot}/subfolder/Converter.cfc -- the Converter component cannot implement the IConvertable interface unless it uses the entire webroot path up to the interface. This is not true if a component is implementing an interface that is in a folder in the same directory as the component. You CAN implement interfaces in directories at the same or deeper than the current component. You CANNOT implement interfaces in the parent directory (or higher) than the current component.
Vote by External U.
22663 | November 11, 2011 12:41:13 AM GMT
This looks like usage issue. Either relative path is specified in interface it should import the folder where User.cfc is present. Also in User.cfc returnUser method should either return fullyQualified name or relative nam( User). (Comment added from ex-user id:sandeepp)
Comment by Adobe D.
22661 | November 21, 2014 06:06:33 AM GMT
This is usage issue: Here is the modified code: IHasUser.cfc (under com folder ) -------------------------------------------------- // in \com\IHasUser.cfc: interface { com.user.User function getUser(); } User.cfc (under com/user folder) ------------------------------------------------ // in com\user\User.cfc component implements="com.IHasUser" { com.user.User function getUser(){ return this; }; } CF-3040316.cfm (at same level as com folder) ------------------------------------------------------------------ <cfset a = createObject("component", "com.user.User")> <cfset b = a.getUser()> <cfdump var="#b#"> So the usage should be use fully qualified name else relative path(User) in all places. In case, we are missing something, please let us know.
Comment by HariKrishna K.
22662 | December 05, 2014 05:13:24 AM GMT