activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: ConcurrentModificationException while closing consumer
Date Tue, 10 Feb 2009 17:50:00 GMT
> However, wouldn't static analysis of the code be sufficient in this case?
> The code segment above is the only thing that is not protected by synchronization, whilst
> every other use of this collection is.
>

Static analysis can identify the problem and the fix, but it doesn't
protect the change into the future.
A test case is the only reliable way to do this as it will capture the use case.

I committed a test case[1], it is not perfect but it does reproduce
about 80% of the time.

org.apache.activemq.JMSConsumerTest.testMessageListenerWithConsumerCanBeStoppedConcurently()

Bonnie, I hope this sort of matches your use case.

[1] http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java?view=markup

Mime
View raw message