You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2013/10/31 04:11:59 UTC

[2/4] git commit: Use Properties.clone() instead.

Use Properties.clone() instead.


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/3a388c32
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/3a388c32
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/3a388c32

Branch: refs/heads/master
Commit: 3a388c320c5079bec44fe51d2f8218af2e56d98e
Parents: a6ae2b4
Author: Stephen Haberman <st...@exigencecorp.com>
Authored: Tue Oct 29 19:20:40 2013 -0500
Committer: Stephen Haberman <st...@exigencecorp.com>
Committed: Tue Oct 29 19:20:40 2013 -0500

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/util/Utils.scala | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/3a388c32/core/src/main/scala/org/apache/spark/util/Utils.scala
----------------------------------------------------------------------
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 d637a0a..b20c0e5 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]
   }
 }