commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: [GUMP@vmgump]: Project commons-lang3-test (in module apache-commons) failed
Date Tue, 06 Mar 2012 15:55:51 GMT
On 6 March 2012 12:52, Gary Gregory <> wrote:
> On Mar 6, 2012, at 6:47, sebb <> wrote:
>> The errors are occuring because some testCases are leaving an item in
>> the registry.
>> If the next test is one that checks for an empty registry at the end,
>> it will fail.
>> It's very easy to check that the registry is always left empty by
>> adding an @After method - I tried this and the code then fails for me
>> on WinXP/Eclipse.
>> I don't know if this is a bug in some test cases or a bug in the code
>> - should the registry always be left clean, no matter what call
>> sequence is used?
>> Or are callers required to call toString() or whatever else it is that
>> cleans up the registry?
>> If so, should the main code be changed to clear the registry when
>> creating a StringBuilder (just in case the previous user fails to
>> clear up)?
> I do not think that would work because a caller can create more than
> one builder and the registry is per thread IIRC. :(

Yes, the registry uses ThreadLocal currently.

But if the caller uses multiple builders in a single thread, what
stops the registry entries from interfering with each other?

Was it a mistake to use ThreadLocal for the registry? Should it be per instance?

I've not yet looked at the code in any detail; if anyone else knows
how it is supposed to work, please shout!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message