Skip to content

Commit a4704e7

Browse files
committed
Prefix java.util.AbstractMap
1 parent 6ba2e4f commit a4704e7

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

js/src/main/scala/scala/util/parsing/input/PositionCache.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
package scala.util.parsing.input
1414

15-
import java.util.{AbstractMap, Collections}
15+
import java.util.Collections
1616

1717
private[input] trait PositionCache {
18-
private[input] lazy val indexCache: java.util.Map[CharSequence,Array[Int]] = new AbstractMap[CharSequence, Array[Int]] {
18+
private[input] lazy val indexCache: java.util.Map[CharSequence,Array[Int]] =
19+
new java.util.AbstractMap[CharSequence, Array[Int]] {
20+
override def entrySet() = Collections.emptySet()
1921

20-
override def entrySet() = Collections.emptySet()
21-
22-
// the /dev/null of Maps
23-
override def put(ch: CharSequence, a: Array[Int]) = null
24-
}
22+
// the /dev/null of Maps
23+
override def put(ch: CharSequence, a: Array[Int]) = null
24+
}
2525
}

jvm/src/main/scala/scala/util/parsing/input/PositionCache.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212

1313
package scala.util.parsing.input
1414

15-
import java.util.WeakHashMap
16-
1715
/**
1816
* @author Tomáš Janoušek
1917
*/
2018
private[input] trait PositionCache {
2119
private lazy val indexCacheTL =
2220
// not DynamicVariable as that would share the map from parent to child :-(
2321
new ThreadLocal[java.util.Map[CharSequence, Array[Int]]] {
24-
override def initialValue = new WeakHashMap[CharSequence, Array[Int]]
22+
override def initialValue = new java.util.WeakHashMap[CharSequence, Array[Int]]
2523
}
2624

2725
private[input] def indexCache = indexCacheTL.get

native/src/main/scala/scala/util/parsing/input/PositionCache.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
package scala.util.parsing.input
1414

1515
import java.lang.CharSequence
16-
import java.util.{AbstractMap, Collections}
16+
import java.util.Collections
1717

1818
private[input] trait PositionCache {
19-
private[input] lazy val indexCache: java.util.Map[CharSequence,Array[Int]] = new AbstractMap[CharSequence, Array[Int]] {
19+
private[input] lazy val indexCache: java.util.Map[CharSequence,Array[Int]] =
20+
new java.util.AbstractMap[CharSequence, Array[Int]] {
21+
override def entrySet() = Collections.emptySet()
2022

21-
override def entrySet() = Collections.emptySet()
22-
23-
// the /dev/null of Maps
24-
override def put(ch: CharSequence, a: Array[Int]) = null
25-
}
23+
// the /dev/null of Maps
24+
override def put(ch: CharSequence, a: Array[Int]) = null
25+
}
2626
}

0 commit comments

Comments
 (0)