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


COMMENTS

author: Natasha Sullivan
date: 2014-11-10 08:01:00.899000000

Uploaded patch set 1.

-------------------------------------
author: Natasha Sullivan
date: 2014-11-10 08:16:14.350000000

Patch Set 1: Verified+1

-------------------------------------
author: Cory Peck
date: 2014-11-10 08:33:56.641000000

Patch Set 1: Code-Review+2

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