Skip to content
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
2 changes: 1 addition & 1 deletion library/src/scala/Boolean.scala
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object Boolean extends AnyValCompanion {
def unbox(x: java.lang.Object): Boolean = ???

/** The String representation of the scala.Boolean companion object. */
override def toString = "object scala.Boolean"
override def toString() = "object scala.Boolean"

}

2 changes: 1 addition & 1 deletion library/src/scala/Byte.scala
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ object Byte extends AnyValCompanion {
def unbox(x: java.lang.Object): Byte = ???

/** The String representation of the scala.Byte companion object. */
override def toString = "object scala.Byte"
override def toString() = "object scala.Byte"
/** Language mandated coercions from Byte to "wider" types. */
import scala.language.implicitConversions
implicit def byte2short(x: Byte): Short = x.toShort
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Char.scala
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ object Char extends AnyValCompanion {
def unbox(x: java.lang.Object): Char = ???

/** The String representation of the scala.Char companion object. */
override def toString = "object scala.Char"
override def toString() = "object scala.Char"
/** Language mandated coercions from Char to "wider" types. */
import scala.language.implicitConversions
implicit def char2int(x: Char): Int = x.toInt
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Double.scala
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@ object Double extends AnyValCompanion {
def unbox(x: java.lang.Object): Double = ???

/** The String representation of the scala.Double companion object. */
override def toString = "object scala.Double"
override def toString() = "object scala.Double"
}

6 changes: 3 additions & 3 deletions library/src/scala/Enumeration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ abstract class Enumeration (initial: Int) extends Serializable {

/** The name of this enumeration.
*/
override def toString: String =
override def toString(): String =
getClass.getName
.stripSuffix(MODULE_SUFFIX_STRING)
.split('.')
.last
.last
.split(Regex.quote(NAME_JOIN_STRING))
.last

Expand Down Expand Up @@ -241,7 +241,7 @@ abstract class Enumeration (initial: Int) extends Serializable {
case that: Enumeration#Value => (outerEnum eq that.outerEnum) && (id == that.id)
case _ => false
}
override def hashCode: Int = id.##
override def hashCode(): Int = id.##

/** Create a ValueSet which contains this value and another one */
def + (v: Value): ValueSet = ValueSet(this, v)
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Float.scala
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ object Float extends AnyValCompanion {
def unbox(x: java.lang.Object): Float = ???

/** The String representation of the scala.Float companion object. */
override def toString = "object scala.Float"
override def toString() = "object scala.Float"
/** Language mandated coercions from Float to "wider" types. */
import scala.language.implicitConversions
implicit def float2double(x: Float): Double = x.toDouble
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Int.scala
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ object Int extends AnyValCompanion {
def unbox(x: java.lang.Object): Int = ???

/** The String representation of the scala.Int companion object. */
override def toString = "object scala.Int"
override def toString() = "object scala.Int"
/** Language mandated coercions from Int to "wider" types. */
import scala.language.implicitConversions
@deprecated("Implicit conversion from Int to Float is dangerous because it loses precision. Write `.toFloat` instead.", "2.13.1")
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Long.scala
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ object Long extends AnyValCompanion {
def unbox(x: java.lang.Object): Long = ???

/** The String representation of the scala.Long companion object. */
override def toString = "object scala.Long"
override def toString() = "object scala.Long"
/** Language mandated coercions from Long to "wider" types. */
import scala.language.implicitConversions
@deprecated("Implicit conversion from Long to Float is dangerous because it loses precision. Write `.toFloat` instead.", "2.13.1")
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/Predef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ object Predef extends LowPriorityImplicits {
def length: Int = sequenceOfChars.length
def charAt(index: Int): Char = sequenceOfChars(index)
def subSequence(start: Int, end: Int): CharSequence = new SeqCharSequence(sequenceOfChars.slice(start, end))
override def toString = sequenceOfChars.mkString
override def toString() = sequenceOfChars.mkString
}

/** @group char-sequence-wrappers */
Expand All @@ -453,7 +453,7 @@ object Predef extends LowPriorityImplicits {
def length: Int = arrayOfChars.length
def charAt(index: Int): Char = arrayOfChars(index)
def subSequence(start: Int, end: Int): CharSequence = new runtime.ArrayCharSequence(arrayOfChars, start, end)
override def toString = arrayOfChars.mkString
override def toString() = arrayOfChars.mkString
}

/** @group char-sequence-wrappers */
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/Proxy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ import scala.language.`2.13`
trait Proxy extends Any {
def self: Any

override def hashCode: Int = self.hashCode
override def hashCode(): Int = self.hashCode
override def equals(that: Any): Boolean = that match {
case null => false
case _ =>
val x = that.asInstanceOf[AnyRef]
(x eq this.asInstanceOf[AnyRef]) || (x eq self.asInstanceOf[AnyRef]) || (x.equals(self))
}
override def toString = "" + self
override def toString() = "" + self
}

@deprecated("All members of this object are deprecated.", "2.13.0")
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/ScalaReflectionException.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ import scala.language.`2.13`
case class ScalaReflectionException(msg: String) extends Exception(msg)

object ScalaReflectionException extends scala.runtime.AbstractFunction1[String, ScalaReflectionException]:
override def toString: String = "ScalaReflectionException"
override def toString(): String = "ScalaReflectionException"
2 changes: 1 addition & 1 deletion library/src/scala/Short.scala
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ object Short extends AnyValCompanion {
def unbox(x: java.lang.Object): Short = ???

/** The String representation of the scala.Short companion object. */
override def toString = "object scala.Short"
override def toString() = "object scala.Short"
/** Language mandated coercions from Short to "wider" types. */
import scala.language.implicitConversions
implicit def short2int(x: Short): Int = x.toInt
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Symbol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Symbol private (val name: String) extends Serializable {

@throws(classOf[java.io.ObjectStreamException])
private def readResolve(): Any = Symbol.apply(name)
override def hashCode = name.hashCode()
override def hashCode() = name.hashCode()
override def equals(other: Any) = this eq other.asInstanceOf[AnyRef]
}

Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/UninitializedFieldError.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ final case class UninitializedFieldError(msg: String) extends RuntimeException(m
}

object UninitializedFieldError extends scala.runtime.AbstractFunction1[String, UninitializedFieldError]:
override def toString: String = "UninitializedFieldError"
override def toString(): String = "UninitializedFieldError"
2 changes: 1 addition & 1 deletion library/src/scala/Unit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ object Unit extends AnyValCompanion {
def unbox(x: java.lang.Object): Unit = x.asInstanceOf[scala.runtime.BoxedUnit]

/** The String representation of the scala.Unit companion object. */
override def toString = "object scala.Unit"
override def toString() = "object scala.Unit"
}

2 changes: 1 addition & 1 deletion library/src/scala/collection/ArrayOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object ArrayOps {
private class ArrayView[A](xs: Array[A]) extends AbstractIndexedSeqView[A] {
def length = xs.length
def apply(n: Int) = xs(n)
override def toString: String = immutable.ArraySeq.unsafeWrapArray(xs).mkString("ArrayView(", ", ", ")")
override def toString(): String = immutable.ArraySeq.unsafeWrapArray(xs).mkString("ArrayView(", ", ", ")")
}

/** A lazy filtered array. No filtering is applied until one of `foreach`, `map` or `flatMap` is called. */
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/collection/Iterable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ trait Iterable[+A] extends IterableOnce[A]
* string consists of the `className` of this $coll, followed
* by all elements separated by commas and enclosed in parentheses.
*/
override def toString = mkString(className + "(", ", ", ")")
override def toString() = mkString(className + "(", ", ", ")")

/** Analogous to `zip` except that the elements in each collection are not consumed until a strict operation is
* invoked on the returned `LazyZip2` decorator.
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/collection/Iterator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ trait Iterator[+A] extends IterableOnce[A] with IterableOnceOps[A, Iterator, Ite
// to verify partnerhood we use reference equality on gap because
// type testing does not discriminate based on origin.
private def compareGap(queue: scala.collection.mutable.Queue[A]) = gap eq queue
override def hashCode = gap.hashCode()
override def hashCode() = gap.hashCode()
override def equals(other: Any) = other match {
case x: Partner => x.compareGap(gap) && gap.isEmpty
case _ => super.equals(other)
Expand Down Expand Up @@ -977,7 +977,7 @@ trait Iterator[+A] extends IterableOnce[A] with IterableOnceOps[A, Iterator, Ite
* @return `"<iterator>"`
* @note Reuse: $preservesIterator
*/
override def toString = "<iterator>"
override def toString() = "<iterator>"

@deprecated("Iterator.seq always returns the iterator itself", "2.13.0")
def seq: this.type = this
Expand Down
6 changes: 3 additions & 3 deletions library/src/scala/collection/LazyZipOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ final class LazyZip2[+El1, +El2, C1] private[collection](src: C1, coll1: Iterabl
}
}

override def toString = s"$coll1.lazyZip($coll2)"
override def toString() = s"$coll1.lazyZip($coll2)"
}

object LazyZip2 {
Expand Down Expand Up @@ -273,7 +273,7 @@ final class LazyZip3[+El1, +El2, +El3, C1] private[collection](src: C1,
}
}

override def toString = s"$coll1.lazyZip($coll2).lazyZip($coll3)"
override def toString() = s"$coll1.lazyZip($coll2).lazyZip($coll3)"
}

object LazyZip3 {
Expand Down Expand Up @@ -415,7 +415,7 @@ final class LazyZip4[+El1, +El2, +El3, +El4, C1] private[collection](src: C1,
}
}

override def toString = s"$coll1.lazyZip($coll2).lazyZip($coll3).lazyZip($coll4)"
override def toString() = s"$coll1.lazyZip($coll2).lazyZip($coll3).lazyZip($coll4)"
}

object LazyZip4 {
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/collection/MapView.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ trait MapView[K, +V]

override def withFilter(p: ((K, V)) => Boolean): MapOps.WithFilter[K, V, View, ({ type l[X, Y] = View[(X, Y)] })#l]^{this, p} = new MapOps.WithFilter(this, p)

override def toString: String = super[View].toString
override def toString(): String = super[View].toString

@nowarn("""cat=deprecation&origin=scala\.collection\.Iterable\.stringPrefix""")
override protected def stringPrefix: String = "MapView"
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/collection/StringOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,8 @@ final case class StringView(s: String) extends AbstractIndexedSeqView[Char] {
def length = s.length
@throws[StringIndexOutOfBoundsException]
def apply(n: Int) = s.charAt(n)
override def toString: String = s"StringView($s)"
override def toString(): String = s"StringView($s)"
}

object StringView extends scala.runtime.AbstractFunction1[String, StringView]:
override def toString: String = "StringView"
override def toString(): String = "StringView"
2 changes: 1 addition & 1 deletion library/src/scala/collection/View.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ trait View[+A] extends Iterable[A] with IterableOps[A, View, View[A]] with Itera

override def empty: scala.collection.View[A] = iterableFactory.empty

override def toString: String = className + "(<not computed>)"
override def toString(): String = className + "(<not computed>)"

@nowarn("""cat=deprecation&origin=scala\.collection\.Iterable\.stringPrefix""")
override protected def stringPrefix: String = "View"
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/collection/concurrent/TrieMap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ private[concurrent] final class FailedNode[K, V](p: MainNode[K, V]) extends Main

def knownSize: Int = throw new UnsupportedOperationException

override def toString: String = "FailedNode(%s)".format(p)
override def toString(): String = "FailedNode(%s)".format(p)
}


Expand Down Expand Up @@ -643,7 +643,7 @@ private[collection] final class CNode[K, V](val bitmap: Int, val array: Array[Ba

def string(lev: Int): String = "CNode %x\n%s".format(bitmap, array.map(_.string(lev + 1)).mkString("\n"))

override def toString = {
override def toString() = {
def elems: Seq[String] = array.flatMap {
case sn: SNode[K, V] @uc => Iterable.single(sn.kvPair._2.toString)
case in: INode[K, V] @uc => Iterable.single(augmentString(in.toString).drop(14) + "(" + in.gen + ")")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case that: IteratorWrapper[_] => this.underlying == that.underlying
case _ => false
}
override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

@SerialVersionUID(3L)
Expand All @@ -52,7 +52,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case that: JIteratorWrapper[_] => this.underlying == that.underlying
case _ => false
}
override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

@SerialVersionUID(3L)
Expand All @@ -63,7 +63,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case that: JEnumerationWrapper[_] => this.underlying == that.underlying
case _ => false
}
override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

trait IterableWrapperTrait[A] extends ju.AbstractCollection[A] {
Expand All @@ -79,7 +79,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case that: IterableWrapper[_] => this.underlying == that.underlying
case _ => false
}
override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

@SerialVersionUID(3L)
Expand All @@ -94,7 +94,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case that: JIterableWrapper[_] => this.underlying == that.underlying
case _ => false
}
override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

@SerialVersionUID(3L)
Expand All @@ -111,7 +111,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case that: JCollectionWrapper[_] => this.underlying == that.underlying
case _ => false
}
override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

@SerialVersionUID(3L)
Expand Down Expand Up @@ -285,7 +285,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
// specified in the javadocs of java.util.Map.Entry.hashCode
//
// See https://github.com/scala/bug/issues/10663
override def hashCode = {
override def hashCode() = {
(if (k == null) 0 else k.hashCode()) ^
(if (v == null) 0 else v.hashCode())
}
Expand Down Expand Up @@ -552,7 +552,7 @@ private[collection] object JavaCollectionWrappers extends Serializable {
case _ => false
}

override def hashCode: Int = underlying.hashCode()
override def hashCode(): Int = underlying.hashCode()
}

@SerialVersionUID(3L)
Expand Down
Loading