Status/Resolution/Reason: To Test//Fixed
Reporter/Name(from Bugbase): Erik Madsen / Erik Madsen (ErikMadsen)
Created: 07/06/2012
Components: Language, CF Component
Versions: 9.0.1
Failure Type: Non Functioning
Found In Build/Fixed In Build: 9.0.1 /
Priority/Frequency: Normal / All users will encounter
Locale/System: English / Win 2008 Server x64
Vote Count: 6
Problem Description: A Java class with methods such as "is()" and "contains()" that is instantiated by CF via createObject does not make such methods available.
Steps to Reproduce:
Example 1 (Java Object)
{code:java}
<cfscript>
gate = createObject( "java", "com.braintreegateway.BraintreeGateway" ).init(env,merchant.getMerchantAccountId(), merchant.getMerchantAccountPublicSecret(),merchant.getMerchantAccountPrivateSecret());
req = createObject( "java","com.braintreegateway.CustomerSearchRequest").id().is("#user.getUserId()#");
customer = gate.customer().search(req);
</cfscript>
{code}
Error Thrown: Invalid CFML construct ... ColdFusion was looking at the following text: is
Example 2 (CFC)
<!--- Junk.cfc --->
{code:java}
<cfcomponent>
<cffunction name="is">
<cfreturn true>
</cffunction>
<cffunction name="contains">
<cfreturn true>
</cffunction>
</cfcomponent>
{code}
<!--- test.cfm --->
{code:java}
<cfset o = new Junk()>
<cfoutput>
#o.is()#<br />
#o.contains()#<br />
</cfoutput>
{code}
This - predictably - outputs:
true
true
However we have problems if we introduce a init() method to Junk.cfc, thus:
{code:java}
<cffunction name="init">
<cfreturn this>
</cffunction>
{code}
And then adjust test.cfm accordingly:
{code:java}
#o.init().is()#<br />
#o.init().contains()#<br />
{code}
Actual Result: Compiler error... Invalid CFML construct found on line x at column xx.
ColdFusion was looking at the following text:
is
[...]
coldfusion.compiler.ParseException: Invalid CFML construct found on line 4 at column 19.
at coldfusion.compiler.cfml40.generateParseException(cfml40.java:12135)
[etc]
There is no valid reason why o.init().is() should not be OK if o.is() is fine.
Expected Result:
Any Workarounds: None known
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3231457
External Customer Info:
External Company:
External Customer Name: ErikMadsen
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: