DESCRIPTION

Bug 459833 - ConcurrentModificationException in ServiceLocator.dispose

To avoid complicated locking inside
activate/deactivate/dispose/disposeServices and register methods, change
the type of servicesToDispose from HashMap to ConcurrentHashMap. This
will avoid still possible ConcurrentModificationException in
activate/deactivate/disposeServices methods.

Changed "disposed" and "e4Context" fields to volatile to
avoid wrong values being used in different threads.

Changed registerService() to log an IllegalStateException with
additional information about service/implementor types if the locator
instance was already disposed.

Changed activate/deactivate/disposeServices to use SafeRunner.

Change-Id: If34128da2c9677fe9b12bbcb0cfab0ab45f991c5
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2016-08-08 07:46:36.000000000

Uploaded patch set 8.

-------------------------------------
author: Jayvion Booth
date: 2016-08-08 08:04:47.000000000

Patch Set 8: Verified+1

Hudson was silent but happy:
https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/10037/

-------------------------------------
author: Sienna Tate
date: 2016-08-08 11:25:38.000000000

Patch Set 8: Code-Review+1

As the issue is just for ConcurrentModificationException, the change to ConcurrentHashMap should fix it (so, approved).

Regarding threads, it still can lead to inconsistencies, but as it's out of the scope of this issue, I reported https://bugs.eclipse.org/bugs/show_bug.cgi?id=499354 to deal with that.

-------------------------------------
author: Jayvion Booth
date: 2016-08-08 12:50:40.000000000

Patch Set 9: Patch Set 8 was rebased

-------------------------------------
author: Gerrit Code Review
date: 2016-08-08 16:12:53.000000000

Change has been successfully merged into the git repository by Jayvion Booth

-------------------------------------
