Skip to content

Commit 245ed85

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 1fd0992 commit 245ed85

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

build.sbt

+15-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,21 @@ lazy val xml = crossProject.in(file("."))
3131
// http://stackoverflow.com/questions/16934488
3232
file(System.getProperty("sun.boot.class.path").split(java.io.File.pathSeparator).filter(_.endsWith(java.io.File.separator + "rt.jar")).head)
3333
-> url("http://docs.oracle.com/javase/8/docs/api")
34-
)
35-
)
34+
),
35+
36+
mimaBinaryIssueFilters ++= {
37+
import com.typesafe.tools.mima.core._
38+
import com.typesafe.tools.mima.core.ProblemFilters._
39+
Seq(
40+
// Scala 2.12 deprecated mutable.Stack, so we broke
41+
// binary compatibility for 1.1.0 in the following way:
42+
exclude[IncompatibleMethTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack_="),
43+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.hStack"),
44+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack"),
45+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.attribStack"),
46+
exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.tagStack")
47+
)
48+
})
3649
.jvmSettings(
3750
OsgiKeys.exportPackage := Seq(s"scala.xml.*;version=${version.value}"),
3851

0 commit comments

Comments
 (0)