diff --git a/build.sbt b/build.sbt index 6ddbeb97d..5f7d12942 100644 --- a/build.sbt +++ b/build.sbt @@ -64,6 +64,9 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform) import com.typesafe.tools.mima.core._ import com.typesafe.tools.mima.core.ProblemFilters._ Seq( + // Deprecated in 2.0.0-RC2 + exclude[MissingClassProblem]("scala.xml.factory.LoggedNodeFactory"), + exclude[DirectMissingMethodProblem]("scala.xml.parsing.MarkupHandler.log"), // because we reverted #279 exclude[DirectMissingMethodProblem]("scala.xml.Utility.escapeText"), // New MiMa checks for generic signature changes diff --git a/shared/src/main/scala/scala/xml/factory/LoggedNodeFactory.scala b/shared/src/main/scala/scala/xml/factory/LoggedNodeFactory.scala deleted file mode 100644 index a1932cb92..000000000 --- a/shared/src/main/scala/scala/xml/factory/LoggedNodeFactory.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Scala (https://www.scala-lang.org) - * - * Copyright EPFL and Lightbend, Inc. - * - * Licensed under Apache License 2.0 - * (http://www.apache.org/licenses/LICENSE-2.0). - * - * See the NOTICE file distributed with this work for - * additional information regarding copyright ownership. - */ - -package scala -package xml -package factory - -import scala.collection.Seq - -/** - * This class logs what the nodefactory is actually doing. - * If you want to see what happens during loading, use it like this: - * {{{ - * object testLogged extends App { - * val x = new scala.xml.parsing.NoBindingFactoryAdapter - * with scala.xml.factory.LoggedNodeFactory[scala.xml.Elem] { - * override def log(s: String) = println(s) - * } - * - * Console.println("Start") - * val doc = x.load(new java.net.URL("http://example.com/file.xml")) - * Console.println("End") - * Console.println(doc) - * } - * }}} - * - * @author Burak Emir - */ -@deprecated("This trait will be removed.", "2.11") -trait LoggedNodeFactory[A <: Node] extends NodeFactory[A] { - // configuration values - val logNode = true - val logText = false - val logComment = false - val logProcInstr = false - - final val NONE = 0 - final val CACHE = 1 - final val FULL = 2 - /** 0 = no logging, 1 = cache hits, 2 = detail */ - val logCompressLevel = 1 - - // methods of NodeFactory - - /** logged version of makeNode method */ - override def makeNode(pre: String, label: String, attrSeq: MetaData, - scope: NamespaceBinding, children: Seq[Node]): A = { - if (logNode) - log("[makeNode for " + label + "]") - - val hash = Utility.hashCode(pre, label, attrSeq.##, scope.##, children) - - /* - if(logCompressLevel >= FULL) { - log("[hashcode total:"+hash); - log(" elem name "+uname+" hash "+ ? )); - log(" attrs "+attrSeq+" hash "+attrSeq.hashCode()); - log(" children :"+children+" hash "+children.hashCode()); - } - */ - if (!cache.get(hash).isEmpty && (logCompressLevel >= CACHE)) - log("[cache hit !]") - - super.makeNode(pre, label, attrSeq, scope, children) - } - - override def makeText(s: String) = { - if (logText) - log("[makeText:\"" + s + "\"]") - super.makeText(s) - } - - override def makeComment(s: String): Seq[Comment] = { - if (logComment) - log("[makeComment:\"" + s + "\"]") - super.makeComment(s) - } - - override def makeProcInstr(t: String, s: String): Seq[ProcInstr] = { - if (logProcInstr) - log("[makeProcInstr:\"" + t + " " + s + "\"]") - super.makeProcInstr(t, s) - } - - def log(msg: String): Unit = {} -} diff --git a/shared/src/main/scala/scala/xml/parsing/MarkupHandler.scala b/shared/src/main/scala/scala/xml/parsing/MarkupHandler.scala index bd4a2715d..886ee3499 100755 --- a/shared/src/main/scala/scala/xml/parsing/MarkupHandler.scala +++ b/shared/src/main/scala/scala/xml/parsing/MarkupHandler.scala @@ -129,7 +129,4 @@ abstract class MarkupHandler { def unparsedEntityDecl(name: String, extID: ExternalID, notat: String): Unit = () def notationDecl(notat: String, extID: ExternalID): Unit = () def reportSyntaxError(pos: Int, str: String): Unit - - @deprecated("This method and its usages will be removed. Use a debugger to debug code.", "2.11") - def log(msg: String): Unit = {} }