commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38792] - [lang] Memory "leak" in StringUtils
Date Mon, 06 Mar 2006 20:05:40 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38792>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38792





------- Additional Comments From Sandy@McArthur.org  2006-03-06 20:05 -------
Has it been shown that the PADDING caching actually benefits anything? I think
it should be removed as it's just going to consume more and more memory until
the StringUtils class is unloaded.

Either way the StringUtils.padding(int,char) should be changed to use a
StringBuffer. I'd change the method to:

private static String padding(int repeat, char padChar) {
  StringBuffer sb = new StringBuffer(repeat); 
  while (sb.length() < repeat) {
    pad = pad.concat(pad);
  }
  return sb.toString();
}

and remove the PADDING static field.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message