diff options
author | Eike Stepper | 2016-07-31 05:28:34 +0000 |
---|---|---|
committer | Eike Stepper | 2016-08-25 08:31:44 +0000 |
commit | f73a5e42940812af44a6e90f72ff398a710b8658 (patch) | |
tree | 08bbe741b913334dd32a8d7b3084a917cc8edd68 | |
parent | 58eb0dd28337648b9e53f259111355cb90ed9333 (diff) | |
download | cdo-f73a5e42940812af44a6e90f72ff398a710b8658.tar.gz cdo-f73a5e42940812af44a6e90f72ff398a710b8658.tar.xz cdo-f73a5e42940812af44a6e90f72ff398a710b8658.zip |
[494993] CDORemoteSessionManager.getRemoteSessions() can raise a ConcurentModificationException or a NullPointerException is a remote user closes his session
Bug: 494993
Change-Id: I80f77c48240c099d1740b7aa6016ecb06de83c71
Signed-off-by: Steve Monnier <steve.monnier@obeo.fr>
Signed-off-by: Eike Stepper <stepper@esc-net.de>
-rw-r--r-- | plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionManagerImpl.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionManagerImpl.java index 77e0777761..b16e8d8901 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionManagerImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/remote/CDORemoteSessionManagerImpl.java @@ -39,7 +39,7 @@ import java.util.Set; /** * @author Eike Stepper */ -public class CDORemoteSessionManagerImpl extends Container<CDORemoteSession>implements InternalCDORemoteSessionManager +public class CDORemoteSessionManagerImpl extends Container<CDORemoteSession> implements InternalCDORemoteSessionManager { private InternalCDOSession localSession; @@ -65,20 +65,17 @@ public class CDORemoteSessionManagerImpl extends Container<CDORemoteSession>impl public CDORemoteSession[] getRemoteSessions() { - Collection<CDORemoteSession> remoteSessions; synchronized (this) { if (subscribed) { - remoteSessions = this.remoteSessions.values(); + Collection<CDORemoteSession> values = remoteSessions.values(); + return values.toArray(new CDORemoteSession[values.size()]); } - else - { - remoteSessions = localSession.getSessionProtocol().getRemoteSessions(this, false); - } - } - return remoteSessions.toArray(new CDORemoteSession[remoteSessions.size()]); + List<CDORemoteSession> loadedRemoteSessions = localSession.getSessionProtocol().getRemoteSessions(this, false); + return loadedRemoteSessions.toArray(new CDORemoteSession[loadedRemoteSessions.size()]); + } } public CDORemoteSession[] getElements() |