tracker issue : CF-3040880

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

Bug 81910:Currently there is no way in CFScript based components to add custom metadata to arguments

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Mark Mandel / Mark Mandel (mark.mandel)

Created: 02/01/2010

Components: Language, CFSCRIPT

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 / 270120

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Platforms All

Vote Count: 1

Problem:

Currently there is no way in CFScript based components to add custom metadata to arguments.It says that it is possible in the documentation: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSE99A664D-44E3-44d1-92A0-5FDF8D82B55C.html#WSf01dbd23413dda0e-66bfe46b1200fb22099-7ffcBut it appears never to have been implemented.It would be very useful for there to be a way to add custom meta data to function arguments like you can with tags.
Method:

<!--- compmetadata.cfc --->
/** 
*Comment text, treated as a hint. 
*Set metadata, including, optionally, attributes, in the last entries 
*in the comment block, as follows: 
*@customcfcmetadata custom cfc
*/ 
component{
	/**
	*@arg1 test
	*/
	public string function foo(required string arg1="default" customargumentmetadata="test") description="test" customfunctionmetadata="function metadata"
	{ 
		return arguments.arg1;
	}
}	



<!--- main.cfm --->
<cfset c = new compmetadata()>
<cfoutput>#c.foo("vamsee")#</cfoutput>
<cfdump var="#getmetadata(c)#">

If we run main.cfm, we get an error.


<!--- tag version that works --->
<!--- compmetadatatag.cfc --->
<cfcomponent hint="Comment text, treated as a hint" customcfcmetadata="cfc metadata">
	<cffunction name="foo" returntype="string" access="public" customfnmetadata="function metadata" description="test">
		<cfargument name="arg1" required="true" type="string" default="default" customargumentmetadata="argument metadata">
		<cfreturn arguments.arg1>
	</cffunction>	
</cfcomponent>


<!--- maintag.cfm --->
<cfset c = new compmetadatatag()>
<cfoutput>#c.foo("vamsee")#</cfoutput>
<cfdump var="#getmetadata(c)#">
Result:

 Invalid CFML construct found on line 11 at column 67.
ColdFusion was looking at the following text:

customargumentmetadata

The CFML compiler was processing:

    * A script statement beginning with public on line 11, column 9.

 
The error occurred in C:\work\ColdFusion\cf_main\cfusion\wwwroot\bugs\81910\compmetadata.cfc: line 11

9 : 	*@arg1 test
10 : 	*/
11 : 	public string function foo(required string arg1="default" customargumentmetadata="test") description="test" customfunctionmetadata="function metadata"
12 : 	{ 
13 : 		return arguments.arg1;

Resources:

    * Check the ColdFusion documentation to verify that you are using the correct syntax.
    * Search the Knowledge Base to find a solution to your problem.

Browser   	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Remote Address   	127.0.0.1
Referrer   	
Date/Time   	02-Feb-10 02:39 PM
Stack Trace
at cfmain2ecfm1370126796.runPage(C:\work\ColdFusion\cf_main\cfusion\wwwroot\bugs\81910\main.cfm:1)

coldfusion.compiler.ParseException: Invalid CFML construct found on line 11 at column 67.
	at coldfusion.compiler.cfml40.generateParseException(cfml40.java:12091)
	at coldfusion.compiler.cfml40.jj_consume_token(cfml40.java:11962)
	at coldfusion.compiler.cfml40.parameterDefinition(cfml40.java:3260)
	at coldfusion.compiler.cfml40.functionDefinition(cfml40.java:2985)
	at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1523)
	at coldfusion.compiler.cfml40.start(cfml40.java:4577)
	at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:706)
	at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:651)
	at coldfusion.compiler.NeoTranslator.parseAndTransform(NeoTranslator.java:404)
	at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:346)
	at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:147)
	at coldfusion.runtime.TemplateClassLoader$TemplateCache$1.fetch(TemplateClassLoader.java:424)
	at coldfusion.util.LruCache.get(LruCache.java:180)
	at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(TemplateClassLoader.java:362)
	at coldfusion.util.AbstractCache.fetch(AbstractCache.java:58)
	at coldfusion.util.SoftCache.get_statsOff(SoftCache.java:133)
	at coldfusion.util.SoftCache.get(SoftCache.java:81)
	at coldfusion.runtime.TemplateClassLoader.findClass(TemplateClassLoader.java:604)
	at coldfusion.cfc.ComponentProxyFactory.getProxy(ComponentProxyFactory.java:56)
	at coldfusion.runtime.CFPage.___createObjectInternal(CFPage.java:8453)
	at coldfusion.runtime.CFPage._createObject(CFPage.java:8440)
	at cfmain2ecfm1370126796.runPage(C:\work\ColdFusion\cf_main\cfusion\wwwroot\bugs\81910\main.cfm:1)
	at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
	at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
	at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
	at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)
	at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
	at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
	at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
	at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
	at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
	at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
	at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
	at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
	at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
	at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
	at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)
	at coldfusion.CfmServlet.service(CfmServlet.java:200)
	at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
	at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
	at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
	at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
	at jrun.servlet.FilterChain.service(FilterChain.java:101)
	at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
	at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
	at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
	at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
	at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
	at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
	at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
	at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

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

Watson Bug ID:	3040880

External Customer Info:
External Company:  
External Customer Name: Mark Mandel
External Customer Email: 3EA9517D445A9E8999201549
External Test Config: 02/01/2010

Attachments:

Comments: