Skip to content

Commit 64b7dbd

Browse files
committed
Add mima exclude filters for mutable.Stack
Scala 2.12.2 produced a lot more warnings about deprecation. One of them that affected scala-xml suggested dropping mutable.Stack in favor of immutable.List and var. I tried to preserve binary compatibility by creating members that use the collection.mutable.Stack.apply factory method, since it won't produce deprecation warnings. Must be only the constructor has deprecation warnings? Regardless, I was committing fraudulent binary compatibility: I created members of the type mima wants, but the values are not actually used. In all likelihood, no one uses the members of FactoryAdapter. We will just change everything to List, drop the use of mutable.Stack entirely, break bincompat, add entries to mimaBinaryIssueFilters, inform users, and call it fixed.
1 parent 39753a6 commit 64b7dbd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

build.sbt

+13
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform)
2424
mimaPreviousVersion := {
2525
Some("1.2.0")
2626
},
27+
mimaBinaryIssueFilters ++= {
28+
import com.typesafe.tools.mima.core._
29+
import com.typesafe.tools.mima.core.ProblemFilters._
30+
Seq(
31+
// Scala 2.12 deprecated mutable.Stack, so we broke
32+
// binary compatibility for 1.1.0 in the following way:
33+
exclude[IncompatibleMethTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack_="),
34+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.hStack"),
35+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack"),
36+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.attribStack"),
37+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.tagStack")
38+
)
39+
},
2740

2841
unmanagedSourceDirectories in Compile ++= {
2942
(unmanagedSourceDirectories in Compile).value.map { dir =>

0 commit comments

Comments
 (0)