commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Karlsen <davidkarl...@gmail.com>
Subject [LANG] Serious error in lang-3 in reflective toString?
Date Sun, 21 Aug 2011 19:41:59 GMT
Stacktrace:
       .....SomeOtherClass.equals( )
        at java.util.WeakHashMap.isEqual(WeakHashMap.java:737) ~[na:na]
        at java.util.WeakHashMap.put(WeakHashMap.java:612) ~[na:na]
        at
org.apache.commons.lang3.builder.ToStringStyle.register(ToStringStyle.java:182)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
org.apache.commons.lang3.builder.ToStringStyle.appendClassName(ToStringStyle.java:1444)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
org.apache.commons.lang3.builder.ToStringStyle.appendStart(ToStringStyle.java:369)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
org.apache.commons.lang3.builder.ToStringBuilder.<init>(ToStringBuilder.java:263)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
org.apache.commons.lang3.builder.ReflectionToStringBuilder.<init>(ReflectionToStringBuilder.java:462)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
org.apache.commons.lang3.builder.ReflectionToStringBuilder.toString(ReflectionToStringBuilder.java:288)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
org.apache.commons.lang3.builder.ReflectionToStringBuilder.toString(ReflectionToStringBuilder.java:119)
~[commons-lang3-3.0.1.jar:3.0.1]
        at
com.edb.finance.common.spring.shortcircuit.State.toString(State.java:92)
~[spring-extensions-2.0-20110818.133301-13.jar:2.0-SNAPSHOT]


There must be a bug in ReflectionToStringBuilder in lang-3 which is not in
lang2 - because it does not happen if I switch to the old classes.
Basically equals is called on an instance of a class which is not reachable
from the object in question (State.java) - this leads me to think that
somehing is dodgy with the caching commons lang is doing.

This only happens on the first execution.
Any further executions work fine - or using commons lang 2.x


--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message