Skip to content

Commit c335181

Browse files
run srewrite version 88d3cd4126d135617a8189f0a855757d7e2ab806 on src/library
1 parent a908ded commit c335181

File tree

159 files changed

+906
-661
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+906
-661
lines changed

src/library/scala/App.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ trait App extends DelayedInit {
5656
* themselves define a `delayedInit` method.
5757
* @param body the initialization code to be stored for later execution
5858
*/
59-
override def delayedInit(body: => Unit) {
59+
override def delayedInit(body: => Unit): Unit = {
6060
initCode += (() => body)
6161
}
6262

src/library/scala/Application.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ trait Application {
7070
*
7171
* @param args the arguments passed to the main method
7272
*/
73-
def main(args: Array[String]) {
73+
def main(args: Array[String]): Unit = {
7474
if (util.Properties propIsSet "scala.time") {
7575
val total = currentTime - executionStart
7676
Console.println("[total " + total + "ms]")

src/library/scala/Array.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object Array extends FallbackArrayBuilding {
7373
srcPos : Int,
7474
dest : AnyRef,
7575
destPos : Int,
76-
length : Int) {
76+
length : Int): Unit = {
7777
var i = srcPos
7878
var j = destPos
7979
val srcUntil = srcPos + length
@@ -99,7 +99,7 @@ object Array extends FallbackArrayBuilding {
9999
*
100100
* @see `java.lang.System#arraycopy`
101101
*/
102-
def copy(src: AnyRef, srcPos: Int, dest: AnyRef, destPos: Int, length: Int) {
102+
def copy(src: AnyRef, srcPos: Int, dest: AnyRef, destPos: Int, length: Int): Unit = {
103103
val srcClass = src.getClass
104104
if (srcClass.isArray && dest.getClass.isAssignableFrom(srcClass))
105105
arraycopy(src, srcPos, dest, destPos, length)
@@ -525,7 +525,7 @@ final class Array[T](_length: Int) extends java.io.Serializable with java.lang.C
525525
* @param x the value to be written at index `i`
526526
* @throws ArrayIndexOutOfBoundsException if `i < 0` or `length <= i`
527527
*/
528-
def update(i: Int, x: T) { throw new Error() }
528+
def update(i: Int, x: T): Unit = { throw new Error() }
529529

530530
/** Clone the Array.
531531
*

src/library/scala/Console.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ object Console {
8888
*
8989
* @param out the new output stream.
9090
*/
91-
def setOut(out: PrintStream) { outVar.value = out }
91+
def setOut(out: PrintStream): Unit = { outVar.value = out }
9292

9393
/** Sets the default output stream for the duration
9494
* of execution of one thunk.
@@ -130,7 +130,7 @@ object Console {
130130
*
131131
* @param err the new error stream.
132132
*/
133-
def setErr(err: PrintStream) { errVar.value = err }
133+
def setErr(err: PrintStream): Unit = { errVar.value = err }
134134

135135
/** Set the default error stream for the duration
136136
* of execution of one thunk.
@@ -171,7 +171,7 @@ object Console {
171171
*
172172
* @param reader specifies the new input stream.
173173
*/
174-
def setIn(reader: Reader) {
174+
def setIn(reader: Reader): Unit = {
175175
inVar.value = new BufferedReader(reader)
176176
}
177177

@@ -199,7 +199,7 @@ object Console {
199199
*
200200
* @param in the new input stream.
201201
*/
202-
def setIn(in: InputStream) {
202+
def setIn(in: InputStream): Unit = {
203203
setIn(new InputStreamReader(in))
204204
}
205205

@@ -219,25 +219,25 @@ object Console {
219219
*
220220
* @param obj the object to print; may be null.
221221
*/
222-
def print(obj: Any) {
222+
def print(obj: Any): Unit = {
223223
out.print(if (null == obj) "null" else obj.toString())
224224
}
225225

226226
/** Flushes the output stream. This function is required when partial
227227
* output (i.e. output not terminated by a newline character) has
228228
* to be made visible on the terminal.
229229
*/
230-
def flush() { out.flush() }
230+
def flush(): Unit = { out.flush() }
231231

232232
/** Prints a newline character on the default output.
233233
*/
234-
def println() { out.println() }
234+
def println(): Unit = { out.println() }
235235

236236
/** Prints out an object to the default output, followed by a newline character.
237237
*
238238
* @param x the object to print.
239239
*/
240-
def println(x: Any) { out.println(x) }
240+
def println(x: Any): Unit = { out.println(x) }
241241

242242
/** Prints its arguments as a formatted string to the default output,
243243
* based on a string pattern (in a fashion similar to printf in C).
@@ -250,7 +250,7 @@ object Console {
250250
* @param args the arguments used to instantiating the pattern.
251251
* @throws java.lang.IllegalArgumentException if there was a problem with the format string or arguments
252252
*/
253-
def printf(text: String, args: Any*) { out.print(text format (args : _*)) }
253+
def printf(text: String, args: Any*): Unit = { out.print(text format (args : _*)) }
254254

255255
/** Read a full line from the default input. Returns `null` if the end of the
256256
* input stream has been reached.

src/library/scala/DelayedInit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ package scala
4545
*/
4646
trait DelayedInit {
4747
def delayedInit(x: => Unit): Unit
48-
}
48+
}

src/library/scala/Enumeration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ abstract class Enumeration (initial: Int) extends Serializable {
160160
*/
161161
protected final def Value(i: Int, name: String): Value = new Val(i, name)
162162

163-
private def populateNameMap() {
163+
private def populateNameMap(): Unit = {
164164
val fields = getClass.getDeclaredFields
165165
def isValDef(m: JMethod) = fields exists (fd => fd.getName == m.getName && fd.getType == m.getReturnType)
166166

src/library/scala/LowPriorityImplicits.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class LowPriorityImplicits {
3333
* Even inlined, every call site does a no-op retrieval of Predef's MODULE$
3434
* because maybe loading Predef has side effects!
3535
*/
36-
@inline implicit def byteWrapper(x: Byte) = new runtime.RichByte(x)
37-
@inline implicit def shortWrapper(x: Short) = new runtime.RichShort(x)
38-
@inline implicit def intWrapper(x: Int) = new runtime.RichInt(x)
39-
@inline implicit def charWrapper(c: Char) = new runtime.RichChar(c)
40-
@inline implicit def longWrapper(x: Long) = new runtime.RichLong(x)
41-
@inline implicit def floatWrapper(x: Float) = new runtime.RichFloat(x)
42-
@inline implicit def doubleWrapper(x: Double) = new runtime.RichDouble(x)
43-
@inline implicit def booleanWrapper(x: Boolean) = new runtime.RichBoolean(x)
36+
@inline implicit def byteWrapper(x: Byte) : scala.runtime.RichByte = new runtime.RichByte(x)
37+
@inline implicit def shortWrapper(x: Short) : scala.runtime.RichShort = new runtime.RichShort(x)
38+
@inline implicit def intWrapper(x: Int) : scala.runtime.RichInt = new runtime.RichInt(x)
39+
@inline implicit def charWrapper(c: Char) : scala.runtime.RichChar = new runtime.RichChar(c)
40+
@inline implicit def longWrapper(x: Long) : scala.runtime.RichLong = new runtime.RichLong(x)
41+
@inline implicit def floatWrapper(x: Float) : scala.runtime.RichFloat = new runtime.RichFloat(x)
42+
@inline implicit def doubleWrapper(x: Double) : scala.runtime.RichDouble = new runtime.RichDouble(x)
43+
@inline implicit def booleanWrapper(x: Boolean): scala.runtime.RichBoolean = new runtime.RichBoolean(x)
4444

4545
// These eight implicits exist solely to exclude Null from the domain of
4646
// the boxed types, so that e.g. "var x: Int = null" is a compile time

src/library/scala/Option.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ sealed abstract class Option[+A] extends Product with Serializable {
232232
* @see map
233233
* @see flatMap
234234
*/
235-
@inline final def foreach[U](f: A => U) {
235+
@inline final def foreach[U](f: A => U): Unit = {
236236
if (!isEmpty) f(this.get)
237237
}
238238

src/library/scala/Predef.scala

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ object Predef extends LowPriorityImplicits {
160160
* @param assertion the expression to test
161161
*/
162162
@elidable(ASSERTION)
163-
def assert(assertion: Boolean) {
163+
def assert(assertion: Boolean): Unit = {
164164
if (!assertion)
165165
throw new java.lang.AssertionError("assertion failed")
166166
}
@@ -174,7 +174,7 @@ object Predef extends LowPriorityImplicits {
174174
* @param message a String to include in the failure message
175175
*/
176176
@elidable(ASSERTION) @inline
177-
final def assert(assertion: Boolean, message: => Any) {
177+
final def assert(assertion: Boolean, message: => Any): Unit = {
178178
if (!assertion)
179179
throw new java.lang.AssertionError("assertion failed: "+ message)
180180
}
@@ -189,7 +189,7 @@ object Predef extends LowPriorityImplicits {
189189
* @param assumption the expression to test
190190
*/
191191
@elidable(ASSERTION)
192-
def assume(assumption: Boolean) {
192+
def assume(assumption: Boolean): Unit = {
193193
if (!assumption)
194194
throw new java.lang.AssertionError("assumption failed")
195195
}
@@ -205,7 +205,7 @@ object Predef extends LowPriorityImplicits {
205205
* @param message a String to include in the failure message
206206
*/
207207
@elidable(ASSERTION) @inline
208-
final def assume(assumption: Boolean, message: => Any) {
208+
final def assume(assumption: Boolean, message: => Any): Unit = {
209209
if (!assumption)
210210
throw new java.lang.AssertionError("assumption failed: "+ message)
211211
}
@@ -216,7 +216,7 @@ object Predef extends LowPriorityImplicits {
216216
*
217217
* @param requirement the expression to test
218218
*/
219-
def require(requirement: Boolean) {
219+
def require(requirement: Boolean): Unit = {
220220
if (!requirement)
221221
throw new IllegalArgumentException("requirement failed")
222222
}
@@ -228,7 +228,7 @@ object Predef extends LowPriorityImplicits {
228228
* @param requirement the expression to test
229229
* @param message a String to include in the failure message
230230
*/
231-
@inline final def require(requirement: Boolean, message: => Any) {
231+
@inline final def require(requirement: Boolean, message: => Any): Unit = {
232232
if (!requirement)
233233
throw new IllegalArgumentException("requirement failed: "+ message)
234234
}
@@ -304,9 +304,9 @@ object Predef extends LowPriorityImplicits {
304304

305305
// views --------------------------------------------------------------
306306

307-
implicit def exceptionWrapper(exc: Throwable) = new runtime.RichException(exc)
308-
implicit def tuple2ToZippedOps[T1, T2](x: (T1, T2)) = new runtime.Tuple2Zipped.Ops(x)
309-
implicit def tuple3ToZippedOps[T1, T2, T3](x: (T1, T2, T3)) = new runtime.Tuple3Zipped.Ops(x)
307+
implicit def exceptionWrapper(exc: Throwable) : scala.runtime.RichException = new runtime.RichException(exc)
308+
implicit def tuple2ToZippedOps[T1, T2](x: (T1, T2)) : runtime.Tuple2Zipped.Ops[T1,T2] = new runtime.Tuple2Zipped.Ops(x)
309+
implicit def tuple3ToZippedOps[T1, T2, T3](x: (T1, T2, T3)) : runtime.Tuple3Zipped.Ops[T1,T2,T3] = new runtime.Tuple3Zipped.Ops(x)
310310
implicit def seqToCharSequence(xs: scala.collection.IndexedSeq[Char]): CharSequence = new runtime.SeqCharSequence(xs)
311311
implicit def arrayToCharSequence(xs: Array[Char]): CharSequence = new runtime.ArrayCharSequence(xs, 0, xs.length)
312312

@@ -364,27 +364,27 @@ object Predef extends LowPriorityImplicits {
364364

365365
// "Autoboxing" and "Autounboxing" ---------------------------------------------------
366366

367-
implicit def byte2Byte(x: Byte) = java.lang.Byte.valueOf(x)
368-
implicit def short2Short(x: Short) = java.lang.Short.valueOf(x)
369-
implicit def char2Character(x: Char) = java.lang.Character.valueOf(x)
370-
implicit def int2Integer(x: Int) = java.lang.Integer.valueOf(x)
371-
implicit def long2Long(x: Long) = java.lang.Long.valueOf(x)
372-
implicit def float2Float(x: Float) = java.lang.Float.valueOf(x)
373-
implicit def double2Double(x: Double) = java.lang.Double.valueOf(x)
374-
implicit def boolean2Boolean(x: Boolean) = java.lang.Boolean.valueOf(x)
367+
implicit def byte2Byte(x: Byte) : Byte = java.lang.Byte.valueOf(x)
368+
implicit def short2Short(x: Short) : Short = java.lang.Short.valueOf(x)
369+
implicit def char2Character(x: Char) : Character = java.lang.Character.valueOf(x)
370+
implicit def int2Integer(x: Int) : Integer = java.lang.Integer.valueOf(x)
371+
implicit def long2Long(x: Long) : Long = java.lang.Long.valueOf(x)
372+
implicit def float2Float(x: Float) : Float = java.lang.Float.valueOf(x)
373+
implicit def double2Double(x: Double) : Double = java.lang.Double.valueOf(x)
374+
implicit def boolean2Boolean(x: Boolean) : Boolean = java.lang.Boolean.valueOf(x)
375375

376376
// These next eight implicits exist solely to exclude AnyRef methods from the
377377
// eight implicits above so that primitives are not coerced to AnyRefs. They
378378
// only create such conflict for AnyRef methods, so the methods on the java.lang
379379
// boxed types are unambiguously reachable.
380-
implicit def byte2ByteConflict(x: Byte) = new AnyRef
381-
implicit def short2ShortConflict(x: Short) = new AnyRef
382-
implicit def char2CharacterConflict(x: Char) = new AnyRef
383-
implicit def int2IntegerConflict(x: Int) = new AnyRef
384-
implicit def long2LongConflict(x: Long) = new AnyRef
385-
implicit def float2FloatConflict(x: Float) = new AnyRef
386-
implicit def double2DoubleConflict(x: Double) = new AnyRef
387-
implicit def boolean2BooleanConflict(x: Boolean) = new AnyRef
380+
implicit def byte2ByteConflict(x: Byte) : Object = new AnyRef
381+
implicit def short2ShortConflict(x: Short) : Object = new AnyRef
382+
implicit def char2CharacterConflict(x: Char) : Object = new AnyRef
383+
implicit def int2IntegerConflict(x: Int) : Object = new AnyRef
384+
implicit def long2LongConflict(x: Long) : Object = new AnyRef
385+
implicit def float2FloatConflict(x: Float) : Object = new AnyRef
386+
implicit def double2DoubleConflict(x: Double) : Object = new AnyRef
387+
implicit def boolean2BooleanConflict(x: Boolean) : Object = new AnyRef
388388

389389
implicit def Byte2byte(x: java.lang.Byte): Byte = x.byteValue
390390
implicit def Short2short(x: java.lang.Short): Short = x.shortValue
@@ -397,9 +397,9 @@ object Predef extends LowPriorityImplicits {
397397

398398
// Strings and CharSequences --------------------------------------------------------------
399399

400-
@inline implicit def any2stringfmt(x: Any) = new runtime.StringFormat(x)
400+
@inline implicit def any2stringfmt(x: Any): scala.runtime.StringFormat = new runtime.StringFormat(x)
401401
@inline implicit def augmentString(x: String): StringOps = new StringOps(x)
402-
implicit def any2stringadd(x: Any) = new runtime.StringAdd(x)
402+
implicit def any2stringadd(x: Any): scala.runtime.StringAdd = new runtime.StringAdd(x)
403403
implicit def unaugmentString(x: StringOps): String = x.repr
404404

405405
@deprecated("Use `StringCanBuildFrom`", "2.10.0")

src/library/scala/Responder.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ abstract class Responder[+A] extends Serializable {
6262

6363
def respond(k: A => Unit): Unit
6464

65-
def foreach(k: A => Unit) { respond(k) }
65+
def foreach(k: A => Unit): Unit = { respond(k) }
6666

6767
def map[B](f: A => B) = new Responder[B] {
68-
def respond(k: B => Unit) {
68+
def respond(k: B => Unit): Unit = {
6969
Responder.this.respond(x => k(f(x)))
7070
}
7171
}
7272

7373
def flatMap[B](f: A => Responder[B]) = new Responder[B] {
74-
def respond(k: B => Unit) {
74+
def respond(k: B => Unit): Unit = {
7575
Responder.this.respond(x => f(x).respond(k))
7676
}
7777
}
7878

7979
def filter(p: A => Boolean) = new Responder[A] {
80-
def respond(k: A => Unit) {
80+
def respond(k: A => Unit): Unit = {
8181
Responder.this.respond(x => if (p(x)) k(x) else ())
8282
}
8383
}

src/library/scala/beans/ScalaBeanInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class ScalaBeanInfo(clazz: java.lang.Class[_],
3434

3535
// override def getAdditionalBeanInfo() = Array(Introspector getBeanInfo clazz.getSuperclass)
3636

37-
private def init() {
37+
private def init(): Unit = {
3838
var i = 0;
3939
while (i < props.length) {
4040
pd(i/3) = new PropertyDescriptor(props(i), clazz, props(i+1), props(i+2))

src/library/scala/collection/BitSetLike.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe
111111
else Iterator.empty.next
112112
}
113113

114-
override def foreach[B](f: Int => B) {
114+
override def foreach[B](f: Int => B): Unit = {
115115
for (i <- 0 until nwords) {
116116
val w = word(i)
117117
for (j <- i * WordLength until (i + 1) * WordLength) {

src/library/scala/collection/GenIterable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extends GenIterableLike[A, GenIterable[A]]
3030

3131

3232
object GenIterable extends GenTraversableFactory[GenIterable] {
33-
implicit def canBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
33+
implicit def canBuildFrom[A]: scala.collection.GenIterable.GenericCanBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
3434
def newBuilder[A] = Iterable.newBuilder
3535
}
3636

src/library/scala/collection/GenSeq.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ extends GenSeqLike[A, GenSeq[A]]
3131

3232

3333
object GenSeq extends GenTraversableFactory[GenSeq] {
34-
implicit def canBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
34+
implicit def canBuildFrom[A]: scala.collection.GenSeq.GenericCanBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
3535
def newBuilder[A] = Seq.newBuilder
3636
}

src/library/scala/collection/GenSet.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extends GenSetLike[A, GenSet[A]]
3131

3232

3333
object GenSet extends GenTraversableFactory[GenSet] {
34-
implicit def canBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
34+
implicit def canBuildFrom[A]: scala.collection.GenSet.GenericCanBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
3535
def newBuilder[A] = Set.newBuilder
3636
}
3737

src/library/scala/collection/GenTraversable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extends GenTraversableLike[A, GenTraversable[A]]
3232

3333

3434
object GenTraversable extends GenTraversableFactory[GenTraversable] {
35-
implicit def canBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
35+
implicit def canBuildFrom[A]: scala.collection.GenTraversable.GenericCanBuildFrom[A] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
3636
def newBuilder[A] = Traversable.newBuilder
3737
}
3838

0 commit comments

Comments
 (0)