commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [LANG] Serious error in lang-3 in reflective toString?
Date Sun, 21 Aug 2011 20:42:30 GMT
Hi David,

Would you be able to create a unit test and attach it to a new JIRA?

Gary

On Aug 21, 2011, at 15:42, David Karlsen <davidkarlsen@gmail.com> wrote:

> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message