Skip to content

Commit 3c1523b

Browse files
committed
add -Xfuture option. fix procedure syntax warnings
1 parent 8998e4f commit 3c1523b

24 files changed

+88
-88
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ lazy val xml = crossProject.in(file("."))
2222
name := "scala-xml",
2323
version := "1.1.1-SNAPSHOT",
2424

25-
scalacOptions ++= "-deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_".split("\\s+").to[Seq],
25+
scalacOptions ++= "-deprecation:false -Xfuture -feature -Xlint:-stars-align,-nullary-unit,_".split("\\s+").to[Seq],
2626
scalacOptions in Test += "-Xxml:coalescing",
2727

2828
apiMappings ++= Map(

jvm/src/test/scala/scala/xml/XMLTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class XMLTestJVM {
199199
new java.io.ObjectInputStream(new java.io.ByteArrayInputStream(buffer))
200200
in.readObject().asInstanceOf[A]
201201
}
202-
def check[A, B](x: A, y: B) {
202+
def check[A, B](x: A, y: B): Unit = {
203203
// println("x = " + x)
204204
// println("y = " + y)
205205
// println("x equals y: " + (x equals y) + ", y equals x: " + (y equals x))

jvm/src/test/scala/scala/xml/pull/XMLEventReaderTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class XMLEventReaderTest {
1313

1414
private def toSource(s: String) = new Source {
1515
val iter = s.iterator
16-
override def reportError(pos: Int, msg: String, out: java.io.PrintStream = Console.err) {}
16+
override def reportError(pos: Int, msg: String, out: java.io.PrintStream = Console.err): Unit = {}
1717
}
1818

1919
@Test

shared/src/main/scala/scala/xml/Attribute.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ abstract trait Attribute extends MetaData {
8888
/**
8989
* Appends string representation of only this attribute to stringbuffer.
9090
*/
91-
protected def toString1(sb: StringBuilder) {
91+
protected def toString1(sb: StringBuilder): Unit = {
9292
if (value == null)
9393
return
9494
if (isPrefixed)

shared/src/main/scala/scala/xml/NamespaceBinding.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ case class NamespaceBinding(prefix: String, uri: String, parent: NamespaceBindin
6767

6868
def buildString(stop: NamespaceBinding): String = sbToString(buildString(_, stop))
6969

70-
def buildString(sb: StringBuilder, stop: NamespaceBinding) {
70+
def buildString(sb: StringBuilder, stop: NamespaceBinding): Unit = {
7171
shadowRedefined(stop).doBuildString(sb, stop)
7272
}
7373

74-
private def doBuildString(sb: StringBuilder, stop: NamespaceBinding) {
74+
private def doBuildString(sb: StringBuilder, stop: NamespaceBinding): Unit = {
7575
if (List(null, stop, TopScope).contains(this)) return
7676

7777
val s = " xmlns%s=\"%s\"".format(

shared/src/main/scala/scala/xml/PrettyPrinter.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean) {
9595
}
9696

9797
protected def leafTag(n: Node) = {
98-
def mkLeaf(sb: StringBuilder) {
98+
def mkLeaf(sb: StringBuilder): Unit = {
9999
sb append '<'
100100
n nameToString sb
101101
n.attributes buildString sb
@@ -106,7 +106,7 @@ class PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean) {
106106

107107
protected def startTag(n: Node, pscope: NamespaceBinding): (String, Int) = {
108108
var i = 0
109-
def mkStart(sb: StringBuilder) {
109+
def mkStart(sb: StringBuilder): Unit = {
110110
sb append '<'
111111
n nameToString sb
112112
i = sb.length + 1
@@ -118,7 +118,7 @@ class PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean) {
118118
}
119119

120120
protected def endTag(n: Node) = {
121-
def mkEnd(sb: StringBuilder) {
121+
def mkEnd(sb: StringBuilder): Unit = {
122122
sb append "</"
123123
n nameToString sb
124124
sb append '>'
@@ -203,11 +203,11 @@ class PrettyPrinter(width: Int, step: Int, minimizeEmpty: Boolean) {
203203
* @param n the node to be serialized
204204
* @param sb the stringbuffer to append to
205205
*/
206-
def format(n: Node, sb: StringBuilder) { // entry point
206+
def format(n: Node, sb: StringBuilder): Unit = { // entry point
207207
format(n, TopScope, sb)
208208
}
209209

210-
def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder) { // entry point
210+
def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder): Unit = { // entry point
211211
var lastwasbreak = false
212212
reset()
213213
traverse(n, pscope, 0)

shared/src/main/scala/scala/xml/Utility.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ object Utility extends AnyRef with parsing.TokenTests {
138138
/**
139139
* Adds all namespaces in node to set.
140140
*/
141-
def collectNamespaces(n: Node, set: mutable.Set[String]) {
141+
def collectNamespaces(n: Node, set: mutable.Set[String]): Unit = {
142142
if (n.doCollectNamespaces) {
143143
set += n.namespace
144144
for (a <- n.attributes) a match {

shared/src/main/scala/scala/xml/XML.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ object XML extends XMLLoader[Elem] {
107107
* @param xmlDecl if true, write xml declaration
108108
* @param doctype if not null, write doctype declaration
109109
*/
110-
final def write(w: java.io.Writer, node: Node, enc: String, xmlDecl: Boolean, doctype: dtd.DocType, minimizeTags: MinimizeMode.Value = MinimizeMode.Default) {
110+
final def write(w: java.io.Writer, node: Node, enc: String, xmlDecl: Boolean, doctype: dtd.DocType, minimizeTags: MinimizeMode.Value = MinimizeMode.Default): Unit = {
111111
/* TODO: optimize by giving writer parameter to toXML*/
112112
if (xmlDecl) w.write("<?xml version='1.0' encoding='" + enc + "'?>\n")
113113
if (doctype ne null) w.write(doctype.toString() + "\n")

shared/src/main/scala/scala/xml/dtd/ContentModel.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ object ContentModel extends WordExp {
5454
def buildString(r: RegExp): String = sbToString(buildString(r, _))
5555

5656
/* precond: rs.length >= 1 */
57-
private def buildString(rs: Seq[RegExp], sb: StringBuilder, sep: Char) {
57+
private def buildString(rs: Seq[RegExp], sb: StringBuilder, sep: Char): Unit = {
5858
buildString(rs.head, sb)
5959
for (z <- rs.tail) {
6060
sb append sep

shared/src/main/scala/scala/xml/dtd/Decl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ sealed abstract class EntityDef {
103103
}
104104

105105
case class IntDef(value: String) extends EntityDef {
106-
private def validateValue() {
106+
private def validateValue(): Unit = {
107107
var tmp = value
108108
var ix = tmp indexOf '%'
109109
while (ix != -1) {

0 commit comments

Comments
 (0)