DESCRIPTION

SPY-178: KetamaNodeLocator#getReadonlyCopy uses unsafe operations.

Motivation
----------
Users reported java.lang.UnsupportedOperationException when using the
KetamaNodeLocator#getReadonlyCopy() method. It turns out the error
only shows up when the JVM is run with the -XX:+AggressiveOpts flag.

Modifications
-------------
Changing the iterator to properly update the TreeMap while iterating
fixes the problem.

Result
------
Correct behavior for KetamaNodeLocator#getReadonlyCopy(), even when
the -XX:+AggressiveOpts flag is enabled.

Change-Id: I6e7f09892687b8896c9b295a94fb473857ec212f
Reviewed-on: http://review.couchbase.org/43040
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Cory Peck xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-11-10 08:34:38.943000000

Change has been successfully cherry-picked as be9e2ad99a06e4adaf6f133b4d60bff87c27f1fa

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