I was recently trying to use the cfscript version of cfcomponent along with JavaDoc notation and getting error:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
From CF docs:
/**
* custom metadata for a cfc defined using annotation as well as key-value pairs
* @cfcMetadata1 "cfc metadata1"
*/
component cfcMetadata2 = "cfc metadata2"
{
/**
* custom metadata for a property defined using annotation as well as key-value pairs
* @propMetadata1 "property metadata1"
*/
property type="numeric" name="age" default="10" propMetadata2="property metadata2";
/**
* custom metadata for a function/argument using both annotation and key-value pairs
* @arg1.argmdata1 "arg metadata1"
* output true
* @fnMetadata1 "function metadata1"
*/
public string function foo(required numeric arg1=20 argmdata2="arg metadata2") fnMetadata2="function metadata2"
{
writedump(getmetadata(this));
return arg1;
}
}
My Code:
/**
* @displayName Test
* @output false
*
* @since 2016-10-25
* @version 1.0
*/
component {
/**
* I am a test function.
*
* @limitFrom.required false
* @limitFrom.default 0
*
* @limitBy.required false
* @limitBy.default 0
*
* @returnFormat "json"
*
* @since 2016-10-25
* @version 1.0
*/
remote query function test(
numeric limitFrom,
numeric limitBy
) {
return queryNew("");
}
}
This is only happening when I am trying to assign default value to the arguments using the JavaDoc notation i.e.,
@limitFrom.default 0
@limitBy.default 0
Removing these and everything is fine. Not sure why this is happening?
defaultfor function arguments. I also useddefaultforpropertyand it worked as expected so, it seems like a bug. - Beginner