Marek Handl created SANDBOX-477:
-----------------------------------

             Summary: StackOverflowError because hash code used in debug 
messages
                 Key: SANDBOX-477
                 URL: https://issues.apache.org/jira/browse/SANDBOX-477
             Project: Commons Sandbox
          Issue Type: Bug
          Components: Javaflow
            Reporter: Marek Handl
            Priority: Critical


JavaFlow often uses hash codes of objects in debug log messages. When the 
object is a map that contains a reference to itself, an infinite loop occurs 
which ends with a *StackOverflowError* exception.

Although Java specs says that extreme caution is advised when having a map 
contain itself as a value, JavaFlow should not do any assumption about data it 
needs to work with and should be able to deal with such a situation.

The hash code is computed in 
{{org.apache.commons.javaflow.utils.ReflectionUtils.getClassName(final Object 
o)}} which is called e.g. from 
{{org.apache.commons.javaflow.bytecode.Stack.pushObject(Object o)}}.

Possible workaround is to disable debug messages.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to