Skip to content

Commit 80d00f3

Browse files
committed
replace deprecated AnyRefMap
1 parent e52aea4 commit 80d00f3

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeSkelBuilder.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ trait BCodeSkelBuilder extends BCodeHelpers {
515515
*/
516516
object locals {
517517

518-
private val slots = mutable.AnyRefMap.empty[Symbol, Local] // (local-or-param-sym -> Local(BType, name, idx, isSynth))
518+
private val slots = mutable.HashMap.empty[Symbol, Local] // (local-or-param-sym -> Local(BType, name, idx, isSynth))
519519

520520
private var nxtIdx = -1 // next available index for local-var
521521

compiler/src/dotty/tools/dotc/classpath/DirectoryClassPath.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ final class CtSymClassPath(ctSym: java.nio.file.Path, release: Int) extends Clas
229229

230230
// e.g. "java.lang" -> Seq(/876/java/lang, /87/java/lang, /8/java/lang))
231231
private val packageIndex: scala.collection.Map[String, scala.collection.Seq[Path]] = {
232-
val index = collection.mutable.AnyRefMap[String, collection.mutable.ListBuffer[Path]]()
232+
val index = collection.mutable.HashMap[String, collection.mutable.ListBuffer[Path]]()
233233
val isJava12OrHigher = scala.util.Properties.isJavaAtLeast("12")
234234
rootsForRelease.foreach(root => Files.walk(root).iterator().asScala.filter(Files.isDirectory(_)).foreach { p =>
235235
val moduleNamePathElementCount = if (isJava12OrHigher) 1 else 0

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ class TreeUnpickler(reader: TastyReader,
14321432
extendOnly(namedArgs)
14331433
else
14341434
// needs reordering, and possibly fill in holes for default arguments
1435-
val argsByName = mutable.AnyRefMap.from(namedArgs.map(arg => arg.name -> arg))
1435+
val argsByName = mutable.HashMap.from(namedArgs.map(arg => arg.name -> arg))
14361436
val reconstructedArgs = formalNames.lazyZip(methType.paramInfos).map { (name, tpe) =>
14371437
argsByName.remove(name).getOrElse(makeDefault(name, tpe))
14381438
}

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
161161
private val entries = new Array[AnyRef](index.length)
162162

163163
/** A map from symbols to their associated `decls` scopes */
164-
private val symScopes = mutable.AnyRefMap[Symbol, Scope]()
164+
private val symScopes = mutable.HashMap[Symbol, Scope]()
165165

166166
/** A mapping from method types to the parameters used in constructing them */
167167
private val paramsOfMethodType = new java.util.IdentityHashMap[MethodType, List[Symbol]]

compiler/src/dotty/tools/dotc/typer/Namer.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,30 @@ class Namer { typer: Typer =>
6666
/** A partial map from unexpanded member and pattern defs and to their expansions.
6767
* Populated during enterSyms, emptied during typer.
6868
*/
69-
//lazy val expandedTree = new mutable.AnyRefMap[DefTree, Tree]
69+
//lazy val expandedTree = new mutable.HashMap[DefTree, Tree]
7070
/*{
71-
override def default(tree: DefTree) = tree // can't have defaults on AnyRefMaps :-(
71+
override def default(tree: DefTree) = tree // can't have defaults on HashMaps :-(
7272
}*/
7373

7474
/** A map from expanded MemberDef, PatDef or Import trees to their symbols.
7575
* Populated during enterSyms, emptied at the point a typed tree
7676
* with the same symbol is created (this can be when the symbol is completed
7777
* or at the latest when the tree is typechecked.
7878
*/
79-
//lazy val symOfTree = new mutable.AnyRefMap[Tree, Symbol]
79+
//lazy val symOfTree = new mutable.HashMap[Tree, Symbol]
8080

8181
/** A map from expanded trees to their typed versions.
8282
* Populated when trees are typechecked during completion (using method typedAhead).
8383
*/
84-
// lazy val typedTree = new mutable.AnyRefMap[Tree, tpd.Tree]
84+
// lazy val typedTree = new mutable.HashMap[Tree, tpd.Tree]
8585

8686
/** A map from method symbols to nested typers.
8787
* Populated when methods are completed. Emptied when they are typechecked.
8888
* The nested typer contains new versions of the four maps above including this
8989
* one, so that trees that are shared between different DefDefs can be independently
9090
* used as indices. It also contains a scope that contains nested parameters.
9191
*/
92-
lazy val nestedTyper: mutable.AnyRefMap[Symbol, Typer] = new mutable.AnyRefMap
92+
lazy val nestedTyper: mutable.HashMap[Symbol, Typer] = new mutable.HashMap
9393

9494
/** We are entering symbols coming from a SourceLoader */
9595
private var lateCompile = false

compiler/src/dotty/tools/dotc/util/FreshNameCreator.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract class FreshNameCreator {
1414
object FreshNameCreator {
1515
class Default extends FreshNameCreator {
1616
protected var counter: Int = 0
17-
protected val counters: mutable.Map[String, Int] = mutable.AnyRefMap() withDefaultValue 0
17+
protected val counters: mutable.Map[String, Int] = mutable.HashMap() withDefaultValue 0
1818

1919
/**
2020
* Create a fresh name with the given prefix. It is guaranteed

library/src/scala/runtime/coverage/Invoker.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package scala.runtime.coverage
33
import scala.annotation.internal.sharable
44
import scala.annotation.nowarn
55
import scala.collection.concurrent.TrieMap
6-
import scala.collection.mutable.{BitSet, AnyRefMap}
6+
import scala.collection.mutable.{BitSet, HashMap}
77
import java.io.{File, FileWriter}
88
import java.nio.file.Files
99

@@ -12,7 +12,7 @@ object Invoker {
1212
private val runtimeUUID = java.util.UUID.randomUUID()
1313

1414
private val MeasurementsPrefix = "scoverage.measurements."
15-
private val threadFiles = new ThreadLocal[AnyRefMap[String, FileWriter]]
15+
private val threadFiles = new ThreadLocal[HashMap[String, FileWriter]]
1616
private val dataDirToSet = TrieMap.empty[String, BitSet]
1717

1818
/** We record that the given id has been invoked by appending its id to the coverage data file.
@@ -38,7 +38,7 @@ object Invoker {
3838
if added then
3939
var writers = threadFiles.get()
4040
if writers == null then
41-
writers = AnyRefMap.empty
41+
writers = HashMap.empty
4242
threadFiles.set(writers)
4343
val writer = writers.getOrElseUpdate(
4444
dataDir,

0 commit comments

Comments
 (0)