commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Illgner (JIRA)" <>
Subject [jira] [Created] (LANG-1322) ToStringStyle should not use WeakHashMap as registry
Date Fri, 21 Apr 2017 13:42:04 GMT
Michael Illgner created LANG-1322:

             Summary: ToStringStyle should not use WeakHashMap as registry
                 Key: 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

View raw message