Skip to content

Commit

Permalink
Merge branch '1.10.x' into merge-1-x
Browse files Browse the repository at this point in the history
  • Loading branch information
Friendseeker committed Oct 19, 2024
2 parents c170707 + f136f98 commit 920d07f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def mimaSettings: Seq[Setting[?]] = Seq(
"1.5.0",
"1.6.0",
"1.7.0",
"1.8.0",
"1.9.0",
"1.10.0",
)
val versions =
if (scalaVersion.value.startsWith("2.12.")) pre140 ++ post140
Expand Down Expand Up @@ -555,6 +558,9 @@ lazy val zincClasspath = (projectMatrix in internalPath / "zinc-classpath")
exclude[IncompatibleResultTypeProblem](
"sbt.internal.inc.classpath.NativeCopyConfig.*"
),
exclude[IncompatibleResultTypeProblem](
"sbt.internal.inc.ReflectUtilities.fields"
),
exclude[IncompatibleSignatureProblem](
"sbt.internal.inc.classpath.NativeCopyConfig.*"
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ package sbt
package internal
package inc

import java.lang.reflect.Field
import scala.collection._

object ReflectUtilities {
Expand All @@ -33,10 +34,10 @@ object ReflectUtilities {

def ancestry(clazz: Class[?]): List[Class[?]] =
if (clazz == classOf[AnyRef] || !classOf[AnyRef].isAssignableFrom(clazz)) List(clazz)
else clazz :: ancestry(clazz.getSuperclass);
else clazz :: ancestry(clazz.getSuperclass)

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

/**
* Collects all `val`s of type `T` defined on value `self`.
Expand Down

0 comments on commit 920d07f

Please sign in to comment.