From 3a388c320c5079bec44fe51d2f8218af2e56d98e Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Tue, 29 Oct 2013 19:20:40 -0500 Subject: Use Properties.clone() instead. --- core/src/main/scala/org/apache/spark/util/Utils.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index d637a0a91d..b20c0e5308 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -823,10 +823,7 @@ private[spark] object Utils extends Logging { /** Returns a copy of the system properties that is thread-safe to iterator over. */ def getSystemProperties(): Map[String, String] = { - try { - return System.getProperties().toMap[String, String] - } catch { - case e: ConcurrentModificationException => getSystemProperties() - } + return System.getProperties().clone() + .asInstanceOf[java.util.Properties].toMap[String, String] } } -- cgit v1.2.3