Author: michael Date: Fri Feb 10 00:16:28 2012 New Revision: 1242615 URL: http://svn.apache.org/viewvc?rev=1242615&view=rev Log: A proposed fix for Wave-332. Avoids concurrent map modification by ensuring the MemorySearchProvider is always operating on a copy of the Mulitmap.
https://issues.apache.org/jira/browse/WAVE-332 https://reviews.apache.org/r/3826/ Modified: incubator/wave/trunk/src/org/waveprotocol/box/server/waveserver/MemorySearchProvider.java Modified: incubator/wave/trunk/src/org/waveprotocol/box/server/waveserver/MemorySearchProvider.java URL: http://svn.apache.org/viewvc/incubator/wave/trunk/src/org/waveprotocol/box/server/waveserver/MemorySearchProvider.java?rev=1242615&r1=1242614&r2=1242615&view=diff ============================================================================== --- incubator/wave/trunk/src/org/waveprotocol/box/server/waveserver/MemorySearchProvider.java (original) +++ incubator/wave/trunk/src/org/waveprotocol/box/server/waveserver/MemorySearchProvider.java Fri Feb 10 00:16:28 2012 @@ -121,15 +121,13 @@ public class MemorySearchProvider implem private Multimap<WaveId, WaveletId> createWavesViewToFilter(final ParticipantId user, final boolean isAllQuery) { Multimap<WaveId, WaveletId> currentUserWavesView; + currentUserWavesView = HashMultimap.create(); + currentUserWavesView.putAll(subscriber.getPerUserWaveView(user)); if (isAllQuery) { // If it is the "all" query - we need to include also waves view of the // shared domain participant. - currentUserWavesView = HashMultimap.create(); - currentUserWavesView.putAll(subscriber.getPerUserWaveView(user)); currentUserWavesView.putAll(subscriber.getPerUserWaveView(sharedDomainParticipantId)); - } else { - currentUserWavesView = subscriber.getPerUserWaveView(user); - } + } return currentUserWavesView; }
