core.java.StringBuffer
the init method doesn't use javacast to send arguments to the java
StringBuffer, so the defaults are setting an initialisation string
rather than a buffer length. The "setup" method behaves correctly
though.
The method really should just contain a call to setup:
<cfscript>
// init the string buffer
variables.buffer = createObject("java","java.lang.StringBuffer");
setup(argumentcollection=arguments);
return this;
</cfscript>
Without the cast the SB is initialising using a string "16", which is
prepended to all output
eg:
<cfset var sb = getPlugin("StringBuffer")>
<cfset sb.append("hello")>
<cfoutput>#sb.getString()</cfoutput>
output is
16hello
<cfset var sb = getPlugin("StringBuffer").init(>
<cfset sb.append("hello")>
<cfoutput>#sb.getString()</cfoutput>
cheers,
CC