diff --git a/jvm/src/test/scala/scala/util/parsing/combinator/t4929.scala b/jvm/src/test/scala/scala/util/parsing/combinator/t4929.scala index 945bb283..ed357cf1 100644 --- a/jvm/src/test/scala/scala/util/parsing/combinator/t4929.scala +++ b/jvm/src/test/scala/scala/util/parsing/combinator/t4929.scala @@ -19,7 +19,7 @@ class t4929 { def test: Unit = { (1 to THREAD_COUNT) foreach { i => val thread = new Thread { - override def run() { + override def run(): Unit = { begin.await(1, TimeUnit.SECONDS) try { while (count.getAndIncrement() < LIMIT && errors.isEmpty) { diff --git a/shared/src/main/scala/scala/util/parsing/json/JSON.scala b/shared/src/main/scala/scala/util/parsing/json/JSON.scala index 479ec021..49ff8978 100644 --- a/shared/src/main/scala/scala/util/parsing/json/JSON.scala +++ b/shared/src/main/scala/scala/util/parsing/json/JSON.scala @@ -83,7 +83,7 @@ object JSON extends Parser { /** * The global (VM) default function for converting a string to a numeric value. */ - def globalNumberParser_=(f: NumericParser) { defaultNumberParser = f } + def globalNumberParser_=(f: NumericParser): Unit = { defaultNumberParser = f } def globalNumberParser : NumericParser = defaultNumberParser /** @@ -91,6 +91,6 @@ object JSON extends Parser { * numeric format on a per-thread basis. Use `globalNumberParser` for a * global override. */ - def perThreadNumberParser_=(f : NumericParser) { numberParser.set(f) } + def perThreadNumberParser_=(f : NumericParser): Unit = { numberParser.set(f) } def perThreadNumberParser : NumericParser = numberParser.get() } diff --git a/shared/src/test/scala/scala/util/parsing/combinator/JsonTest.scala b/shared/src/test/scala/scala/util/parsing/combinator/JsonTest.scala index 84e15bfb..225d5317 100644 --- a/shared/src/test/scala/scala/util/parsing/combinator/JsonTest.scala +++ b/shared/src/test/scala/scala/util/parsing/combinator/JsonTest.scala @@ -35,17 +35,17 @@ class JsonTest { assertTrue("Parse failed for \"%s\"".format(given), (JSON parseRaw given).isDefined) // For this usage, do a raw parse (to JSONObject/JSONArray) - def printJSON(given : String, expected : JSONType) { + def printJSON(given : String, expected : JSONType): Unit = { printJSON(given, JSON.parseRaw, expected) } // For this usage, do a raw parse (to JSONType and subclasses) - def printJSONFull(given : String, expected : Any) { + def printJSONFull(given : String, expected : Any): Unit = { printJSON(given, JSON.parseFull, expected) } // For this usage, do configurable parsing so that you can do raw if desired - def printJSON[T](given : String, parser : String => T, expected : Any) { + def printJSON[T](given : String, parser : String => T, expected : Any): Unit = { parser(given) match { case None => assertTrue("Parse failed for \"%s\"".format(given), false) case Some(parsed) => if (parsed != expected) { diff --git a/shared/src/test/scala/scala/util/parsing/combinator/UnitTestIO.scala b/shared/src/test/scala/scala/util/parsing/combinator/UnitTestIO.scala index ffb6398e..2b609cf3 100644 --- a/shared/src/test/scala/scala/util/parsing/combinator/UnitTestIO.scala +++ b/shared/src/test/scala/scala/util/parsing/combinator/UnitTestIO.scala @@ -4,7 +4,7 @@ import org.junit.Assert.assertEquals class UnitTestIO { @Test - def testUTF8 { + def testUTF8: Unit = { def decode(ch: Int) = new String(Array(ch), 0, 1).getBytes("UTF-8") assert(new String( decode(0x004D), "utf8") == new String(Array(0x004D.asInstanceOf[Char]))) @@ -22,7 +22,7 @@ class UnitTestIO { } @Test - def testSource { + def testSource: Unit = { val s = "Here is a test string" val f = io.Source.fromBytes(s.getBytes("utf-8")) val b = new collection.mutable.ArrayBuffer[Char]()