You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michael Illgner (JIRA)" <ji...@apache.org> on 2017/04/21 13:42:04 UTC
[jira] [Created] (LANG-1322) ToStringStyle should not use
WeakHashMap as registry
Michael Illgner created LANG-1322:
-------------------------------------
Summary: ToStringStyle should not use WeakHashMap as registry
Key: LANG-1322
URL: https://issues.apache.org/jira/browse/LANG-1322
Project: Commons Lang
Issue Type: Bug
Components: lang.builder.*
Affects Versions: 3.5
Reporter: Michael Illgner
org.apache.commons.lang3.builderToStringStyle uses a WeakHashMap as REGISTRY to detect that an object was already added to the StringBuilder to avoid recursion for cyclic object graphs. This is used by RecursiveToStringStyle.
In a low memory situation when the garbage collector starts, the WeakHashMap is cleared and some parts of the potentially cyclic object graph will be logged again.
We run in this problem, when we accidentally logged an HttpServletRequest and a HttpSession using a ReflectiontoStringBuilder
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)