Skip to content

Commit 1a32738

Browse files
committed
Workaround for scala/bug#10418
1 parent 4c1f540 commit 1a32738

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/partest/scala/tools/partest/nest/StreamCapture.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ object StreamCapture {
4141
def withExtraProperties[A](extra: Map[String, String])(action: => A): A = {
4242
val saved = System.getProperties()
4343
val modified = new java.util.Properties()
44-
modified.putAll(saved)
44+
// on Java 9, we need to cast our way around this:
45+
// src/main/scala/scala/tools/partest/nest/StreamCapture.scala:44: ambiguous reference to overloaded definition,
46+
// both method putAll in class Properties of type (x$1: java.util.Map[_, _])Unit
47+
// and method putAll in class Hashtable of type (x$1: java.util.Map[_ <: Object, _ <: Object])Unit
48+
// match argument types (java.util.Properties)
49+
(modified: java.util.Hashtable[AnyRef, AnyRef]).putAll(saved)
4550
extra.foreach { case (k, v) => modified.setProperty(k, v) }
4651
// Trying to avoid other threads seeing the new properties object prior to the new entries
4752
// https://github.com/scala/scala/pull/6391#issuecomment-371346171

0 commit comments

Comments
 (0)