Skip to content

avoid procedure syntax #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions shared/src/main/scala/scala/util/parsing/json/JSON.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ 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

/**
* Defines the function used to convert a numeric string literal into a
* 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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
Expand All @@ -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]()
Expand Down