Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.5
-
None
-
None
Description
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