Skip to content

Commit 7247dfe

Browse files
authored
Merge pull request scala#9753 from lrytz/pr9733-fixup
Change `private[concurrent]` for methods used outside `concurrent`
2 parents 00c4865 + 0eb49ce commit 7247dfe

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

project/MimaFilters.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,8 @@ object MimaFilters extends AutoPlugin {
7373

7474
// #9733
7575
ProblemFilters.exclude[MissingClassProblem]("scala.collection.concurrent.TrieMap$RemovalPolicy$"), // private[concurrent]
76-
// is this a MiMa bug? we really should need these two filters
77-
//ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.concurrent.TrieMap.removeRefEq"), // private[concurrent]
78-
//ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.concurrent.TrieMap.replaceRefEq"), // private[concurrent]
79-
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JConcurrentMapWrapper.removeRefEq"), // private[concurrent]
80-
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JConcurrentMapWrapper.replaceRefEq"), // private[concurrent]
76+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JConcurrentMapWrapper.removeRefEq"), // private[collection]
77+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.convert.JavaCollectionWrappers#JConcurrentMapWrapper.replaceRefEq"), // private[collection]
8178

8279
// #9741
8380
ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.SeqMap$SeqMapBuilderImpl"), // private[SeqMap]

src/library/scala/collection/concurrent/Map.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ trait Map[K, V] extends scala.collection.mutable.Map[K, V] {
119119
* @return `true` if the removal took place, `false` otherwise
120120
*/
121121
// TODO: make part of the API in a future version
122-
private[concurrent] def removeRefEq(k: K, v: V): Boolean = remove(k, v)
122+
private[collection] def removeRefEq(k: K, v: V): Boolean = remove(k, v)
123123

124124
/**
125125
* Replaces the entry for the given key only if it was previously mapped to
@@ -138,7 +138,7 @@ trait Map[K, V] extends scala.collection.mutable.Map[K, V] {
138138
* @return `true` if the entry was replaced, `false` otherwise
139139
*/
140140
// TODO: make part of the API in a future version
141-
private[concurrent] def replaceRefEq(k: K, oldValue: V, newValue: V): Boolean = replace(k, oldValue, newValue)
141+
private[collection] def replaceRefEq(k: K, oldValue: V, newValue: V): Boolean = replace(k, oldValue, newValue)
142142

143143
/**
144144
* Update a mapping for the specified key and its current optionally-mapped value

src/library/scala/collection/concurrent/TrieMap.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ final class TrieMap[K, V] private (r: AnyRef, rtupd: AtomicReferenceFieldUpdater
972972
removehc(k, v, RemovalPolicy.FullEquals, hc).nonEmpty
973973
}
974974

975-
override private[concurrent] def removeRefEq(k: K, v: V): Boolean = {
975+
override private[collection] def removeRefEq(k: K, v: V): Boolean = {
976976
val hc = computeHash(k)
977977
removehc(k, v, RemovalPolicy.ReferenceEq, hc).nonEmpty
978978
}
@@ -982,7 +982,7 @@ final class TrieMap[K, V] private (r: AnyRef, rtupd: AtomicReferenceFieldUpdater
982982
insertifhc(k, hc, newvalue, oldvalue.asInstanceOf[AnyRef], fullEquals = true).nonEmpty
983983
}
984984

985-
override private[concurrent] def replaceRefEq(k: K, oldValue: V, newValue: V): Boolean = {
985+
override private[collection] def replaceRefEq(k: K, oldValue: V, newValue: V): Boolean = {
986986
val hc = computeHash(k)
987987
insertifhc(k, hc, newValue, oldValue.asInstanceOf[AnyRef], fullEquals = false).nonEmpty
988988
}

0 commit comments

Comments
 (0)