From b19ae4406f318fe8dcd7d3d672cfd5ab59edfa34 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 23 Aug 2021 10:42:58 +0100 Subject: [PATCH] Setup to ignore new experimental methods too --- .../scala/com/typesafe/tools/mima/core/TastyUnpickler.scala | 2 +- .../typesafe/tools/mima/lib/analyze/method/MethodChecker.scala | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/com/typesafe/tools/mima/core/TastyUnpickler.scala b/core/src/main/scala/com/typesafe/tools/mima/core/TastyUnpickler.scala index 5d9bd96e..6d4c614c 100644 --- a/core/src/main/scala/com/typesafe/tools/mima/core/TastyUnpickler.scala +++ b/core/src/main/scala/com/typesafe/tools/mima/core/TastyUnpickler.scala @@ -200,7 +200,7 @@ object TastyUnpickler { final case class ClsDef(name: TypeName, template: Template, annots: List[Annot]) extends Tree { def show = s"${annots.map("" + _ + " ").mkString}class $name$template" } final case class Template(meths: List[DefDef]) extends Tree { def show = s"${meths.map("\n " + _).mkString}" } - final case class DefDef(name: Name, annots: List[Annot] = Nil) extends Tree { def show = s"${annots.map("" + _ + " ").mkString} def $name" } + final case class DefDef(name: Name, annots: List[Annot] = Nil) extends Tree { def show = s"${annots.map("" + _ + " ").mkString}def $name" } sealed trait Type extends Tree final case class UnknownType(tag: Int) extends Type { def show = s"UnknownType(${astTagToString(tag)})" } diff --git a/core/src/main/scala/com/typesafe/tools/mima/lib/analyze/method/MethodChecker.scala b/core/src/main/scala/com/typesafe/tools/mima/lib/analyze/method/MethodChecker.scala index 0cdd6867..e1b6e498 100644 --- a/core/src/main/scala/com/typesafe/tools/mima/lib/analyze/method/MethodChecker.scala +++ b/core/src/main/scala/com/typesafe/tools/mima/lib/analyze/method/MethodChecker.scala @@ -138,6 +138,7 @@ private[analyze] object MethodChecker { private def checkDeferredMethodsProblems(oldclazz: ClassInfo, newclazz: ClassInfo): List[Problem] = { for { newmeth <- newclazz.deferredMethods.iterator + if !newmeth.isExperimental problem <- oldclazz.lookupMethods(newmeth).find(_.descriptor == newmeth.descriptor) match { case None => Some(ReversedMissingMethodProblem(newmeth)) case Some(oldmeth) if newclazz.isClass && oldmeth.isConcrete => Some(ReversedAbstractMethodProblem(newmeth)) @@ -158,6 +159,7 @@ private[analyze] object MethodChecker { newInheritedType <- diffInheritedTypes.iterator // if `newInheritedType` is a trait, then the trait's concrete methods should be counted as deferred methods newDeferredMethod <- newInheritedType.deferredMethodsInBytecode + if !newDeferredMethod.isExperimental // checks that the newDeferredMethod did not already exist in one of the oldclazz supertypes if noInheritedMatchingMethod(oldclazz, newDeferredMethod)(_ => true) && // checks that no concrete implementation of the newDeferredMethod is provided by one of the newclazz supertypes