@@ -18,7 +18,7 @@ class TestCallback extends AnalysisCallback
18
18
val classNames = scala.collection.mutable.Map .empty[File , Set [(String , String )]].withDefaultValue(Set .empty)
19
19
val apis : scala.collection.mutable.Map [File , Seq [ClassLike ]] = scala.collection.mutable.Map .empty
20
20
21
- def usedNames = usedNamesAndScopes.mapValues(_.map(_.name))
21
+ def usedNames = usedNamesAndScopes.view. mapValues(_.map(_.name)).toMap
22
22
23
23
override def startSource (source : File ): Unit = {
24
24
assert(! apis.contains(source), s " startSource can be called only once per source file: $source" )
@@ -68,24 +68,24 @@ object TestCallback {
68
68
localInheritance : Map [String , Set [String ]])
69
69
object ExtractedClassDependencies {
70
70
def fromPairs (
71
- memberRefPairs : Seq [(String , String )],
72
- inheritancePairs : Seq [(String , String )],
73
- localInheritancePairs : Seq [(String , String )]
71
+ memberRefPairs : collection. Seq [(String , String )],
72
+ inheritancePairs : collection. Seq [(String , String )],
73
+ localInheritancePairs : collection. Seq [(String , String )]
74
74
): ExtractedClassDependencies = {
75
75
ExtractedClassDependencies (pairsToMultiMap(memberRefPairs),
76
76
pairsToMultiMap(inheritancePairs),
77
77
pairsToMultiMap(localInheritancePairs))
78
78
}
79
79
80
- private def pairsToMultiMap [A , B ](pairs : Seq [(A , B )]): Map [A , Set [B ]] = {
80
+ private def pairsToMultiMap [A , B ](pairs : collection. Seq [(A , B )]): Map [A , Set [B ]] = {
81
81
import scala .collection .mutable .{ HashMap , MultiMap }
82
82
val emptyMultiMap = new HashMap [A , scala.collection.mutable.Set [B ]] with MultiMap [A , B ]
83
83
val multiMap = pairs.foldLeft(emptyMultiMap) {
84
84
case (acc, (key, value)) =>
85
85
acc.addBinding(key, value)
86
86
}
87
87
// convert all collections to immutable variants
88
- multiMap.toMap.mapValues(_.toSet).withDefaultValue(Set .empty)
88
+ multiMap.toMap.view. mapValues(_.toSet).toMap .withDefaultValue(Set .empty)
89
89
}
90
90
}
91
91
}
0 commit comments