Skip to content

Commit f136f98

Browse files
authored
Merge pull request #1475 from Friendseeker/remove-deprecated-openhashmap
[1.x] avoid deprecated `mutable.OpenHashMap`
2 parents ce3dc0b + 7aa4a1f commit f136f98

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

build.sbt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def mimaSettings: Seq[Setting[?]] = Seq(
2929
"1.5.0",
3030
"1.6.0",
3131
"1.7.0",
32+
"1.8.0",
33+
"1.9.0",
34+
"1.10.0",
3235
)
3336
val versions =
3437
if (scalaVersion.value.startsWith("2.12.")) pre140 ++ post140
@@ -641,6 +644,9 @@ lazy val zincClasspath = (projectMatrix in internalPath / "zinc-classpath")
641644
exclude[IncompatibleResultTypeProblem](
642645
"sbt.internal.inc.classpath.NativeCopyConfig.*"
643646
),
647+
exclude[IncompatibleResultTypeProblem](
648+
"sbt.internal.inc.ReflectUtilities.fields"
649+
),
644650
exclude[IncompatibleSignatureProblem](
645651
"sbt.internal.inc.classpath.NativeCopyConfig.*"
646652
),

internal/zinc-classpath/src/main/scala/sbt/internal/inc/ReflectUtilities.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ package sbt
1313
package internal
1414
package inc
1515

16+
import java.lang.reflect.Field
1617
import scala.collection._
1718

1819
object ReflectUtilities {
@@ -33,10 +34,10 @@ object ReflectUtilities {
3334

3435
def ancestry(clazz: Class[?]): List[Class[?]] =
3536
if (clazz == classOf[AnyRef] || !classOf[AnyRef].isAssignableFrom(clazz)) List(clazz)
36-
else clazz :: ancestry(clazz.getSuperclass);
37+
else clazz :: ancestry(clazz.getSuperclass)
3738

38-
def fields(clazz: Class[?]) =
39-
mutable.OpenHashMap(ancestry(clazz).flatMap(_.getDeclaredFields).map(f => (f.getName, f)): _*)
39+
def fields(clazz: Class[?]): mutable.Map[String, Field] =
40+
mutable.AnyRefMap(ancestry(clazz).flatMap(_.getDeclaredFields).map(f => (f.getName, f)): _*)
4041

4142
/**
4243
* Collects all `val`s of type `T` defined on value `self`.

0 commit comments

Comments
 (0)