File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
core/src/test/scala/org/apache/spark/util Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package org.apache.spark.util
19
19
20
20
import java .util .Properties
21
21
22
+ import org .apache .commons .lang3 .SerializationUtils
22
23
import org .scalatest .{BeforeAndAfterEach , Suite }
23
24
24
25
/**
@@ -42,7 +43,11 @@ private[spark] trait ResetSystemProperties extends BeforeAndAfterEach { this: Su
42
43
var oldProperties : Properties = null
43
44
44
45
override def beforeEach (): Unit = {
45
- oldProperties = new Properties (System .getProperties)
46
+ // we need SerializationUtils.clone instead of `new Properties(System.getProperties()` because
47
+ // the later way of creating a copy does not copy the properties but it initializes a new
48
+ // Properties object with the given properties as defaults. They are not recognized at all
49
+ // by standard Scala wrapper over Java Properties then.
50
+ oldProperties = SerializationUtils .clone(System .getProperties)
46
51
super .beforeEach()
47
52
}
48
53
You can’t perform that action at this time.
0 commit comments