Skip to content

Commit b29be0f

Browse files
socadriaanm
authored andcommitted
SI-7469 Remove @deprecated scala.util.logging
1 parent d49d661 commit b29be0f

File tree

5 files changed

+18
-26
lines changed

5 files changed

+18
-26
lines changed

src/library/scala/xml/factory/LoggedNodeFactory.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ package factory
1515
{{{
1616
object testLogged extends App {
1717
val x = new scala.xml.parsing.NoBindingFactoryAdapter
18-
with scala.xml.factory.LoggedNodeFactory[scala.xml.Elem]
19-
with scala.util.logging.ConsoleLogger
18+
with scala.xml.factory.LoggedNodeFactory[scala.xml.Elem] {
19+
override def log(s: String) = println(s)
20+
}
2021
2122
Console.println("Start")
2223
val doc = x.load(new java.net.URL("http://example.com/file.xml"))
@@ -28,7 +29,8 @@ object testLogged extends App {
2829
* @author Burak Emir
2930
* @version 1.0
3031
*/
31-
trait LoggedNodeFactory[A <: Node] extends NodeFactory[A] with scala.util.logging.Logged {
32+
@deprecated("This trait will be removed.", "2.11")
33+
trait LoggedNodeFactory[A <: Node] extends NodeFactory[A] {
3234
// configuration values
3335
val logNode = true
3436
val logText = false
@@ -83,4 +85,6 @@ trait LoggedNodeFactory[A <: Node] extends NodeFactory[A] with scala.util.loggin
8385
super.makeProcInstr(t, s)
8486
}
8587

88+
@deprecated("This method and its usages will be removed. Use a debugger to debug code.", "2.11")
89+
def log(msg: String): Unit = {}
8690
}

src/library/scala/xml/parsing/MarkupHandler.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ package parsing
1414

1515
import scala.collection.mutable
1616
import scala.io.Source
17-
import scala.util.logging.Logged
1817
import scala.xml.dtd._
1918

2019
/** class that handles markup - provides callback methods to MarkupParser.
@@ -26,8 +25,8 @@ import scala.xml.dtd._
2625
* @todo can we ignore more entity declarations (i.e. those with extIDs)?
2726
* @todo expanding entity references
2827
*/
29-
abstract class MarkupHandler extends Logged
30-
{
28+
abstract class MarkupHandler {
29+
3130
/** returns true is this markup handler is validating */
3231
val isValidating: Boolean = false
3332

@@ -122,4 +121,7 @@ abstract class MarkupHandler extends Logged
122121
def unparsedEntityDecl(name: String, extID: ExternalID, notat: String): Unit = ()
123122
def notationDecl(notat: String, extID: ExternalID): Unit = ()
124123
def reportSyntaxError(pos: Int, str: String): Unit
124+
125+
@deprecated("This method and its usages will be removed. Use a debugger to debug code.", "2.11")
126+
def log(msg: String): Unit = {}
125127
}

src/library/scala/xml/parsing/ValidatingMarkupHandler.scala

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ package xml
1313
package parsing
1414

1515
import scala.xml.dtd._
16-
import scala.util.logging.Logged
1716

18-
abstract class ValidatingMarkupHandler extends MarkupHandler with Logged {
17+
abstract class ValidatingMarkupHandler extends MarkupHandler {
1918

2019
var rootLabel:String = _
2120
var qStack: List[Int] = Nil
@@ -26,20 +25,6 @@ abstract class ValidatingMarkupHandler extends MarkupHandler with Logged {
2625

2726
final override val isValidating = true
2827

29-
override def log(msg: String) {}
30-
31-
/*
32-
override def checkChildren(pos: Int, pre: String, label:String,ns:NodeSeq): Unit = {
33-
Console.println("checkChildren()");
34-
val decl = lookupElemDecl(label);
35-
// @todo: nice error message
36-
val res = decl.contentModel.validate(ns);
37-
Console.println("res = "+res);
38-
if(!res)
39-
//sys.error("invalid!");
40-
}
41-
*/
42-
4328
override def endDTD(n:String) = {
4429
rootLabel = n
4530
}
@@ -116,5 +101,4 @@ abstract class ValidatingMarkupHandler extends MarkupHandler with Logged {
116101

117102
/** report a syntax error */
118103
def reportValidationError(pos: Int, str: String): Unit
119-
120104
}

src/library/scala/xml/persistent/CachedFileStorage.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import java.io.{ File, FileOutputStream }
1414
import java.nio.ByteBuffer
1515
import java.nio.channels.Channels
1616
import java.lang.Thread
17-
import scala.util.logging.Logged
17+
1818
import scala.collection.Iterator
1919

2020
/** Mutable storage of immutable xml trees. Everything is kept in memory,
@@ -26,7 +26,7 @@ import scala.collection.Iterator
2626
*
2727
* @author Burak Emir
2828
*/
29-
abstract class CachedFileStorage(private val file1: File) extends Thread with Logged {
29+
abstract class CachedFileStorage(private val file1: File) extends Thread {
3030

3131
private val file2 = new File(file1.getParent, file1.getName+"$")
3232

@@ -123,4 +123,7 @@ abstract class CachedFileStorage(private val file1: File) extends Thread with Lo
123123
this.dirty = true
124124
save()
125125
}
126+
127+
@deprecated("This method and its usages will be removed. Use a debugger to debug code.", "2.11")
128+
def log(msg: String): Unit = {}
126129
}

test/files/jvm/xml01.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import java.io.StringReader
22
import org.xml.sax.InputSource
33

4-
import scala.util.logging._
54
import scala.xml._
65

76
object Test extends App {

0 commit comments

Comments
 (0)