core.java.StringBuffer bug

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

Logged thanks

http://coldbox.assembla.com/spaces/coldbox/milestones/238409-3-0-0rc1

Fixed
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com