Clone System properties before iterating

Iterating over the live set retrieved from System.getProperties() can
cause trouble as any modification to the System properties during
iteration here will trigger concurrent modification exception. It's
safer to first clone the live set and iterate over the clone.

Bug: 36820084
Test: 40000 iterations of CTS unit tests
Change-Id: I647a6cc8ab9d3a51204e635bfd3250c035a77e68
diff --git a/src/org/easymock/internal/EasyMockProperties.java b/src/org/easymock/internal/EasyMockProperties.java
index 5094104..5043095 100644
--- a/src/org/easymock/internal/EasyMockProperties.java
+++ b/src/org/easymock/internal/EasyMockProperties.java
@@ -73,8 +73,8 @@
             }

         }

         // Then overload it with system properties

-        for (Map.Entry<Object, Object> entry : System.getProperties()

-                .entrySet()) {

+        for (Map.Entry<Object, Object> entry : ((Properties)System.getProperties()

+                 .clone()).entrySet()) {

             if (entry.getKey() instanceof String

                     && entry.getKey().toString().startsWith(PREFIX)) {

                 properties.put(entry.getKey(), entry.getValue());