diff options
author | Vojin Jovanovic <gvojin@gmail.com> | 2015-09-29 16:19:29 +0200 |
---|---|---|
committer | Vojin Jovanovic <gvojin@gmail.com> | 2015-09-29 16:19:29 +0200 |
commit | 88ed7637af4cfb40d68af58a385977c2a1703ece (patch) | |
tree | ed94906e1f873a529c2ca4e2490046a0c6c04124 /src/library-aux/scala/AnyRef.scala | |
parent | 46c81c6be94152f8ecf3b9cfc27ca1bb393b46f1 (diff) | |
download | scala-88ed7637af4cfb40d68af58a385977c2a1703ece.tar.gz scala-88ed7637af4cfb40d68af58a385977c2a1703ece.tar.bz2 scala-88ed7637af4cfb40d68af58a385977c2a1703ece.zip |
Fixing signatures of universal methods on `Any` and `AnyRef`.
Methods `getClass`, `isInstanceOf`, `asInstanceOf`, `notify`, `notifyAll`, and `wait` should be final.
Method `getClass` should exist only on Any.
Diffstat (limited to 'src/library-aux/scala/AnyRef.scala')
-rw-r--r-- | src/library-aux/scala/AnyRef.scala | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/library-aux/scala/AnyRef.scala b/src/library-aux/scala/AnyRef.scala index 7217499da7..67090bae47 100644 --- a/src/library-aux/scala/AnyRef.scala +++ b/src/library-aux/scala/AnyRef.scala @@ -100,33 +100,24 @@ trait AnyRef extends Any { */ protected def finalize(): Unit - /** A representation that corresponds to the dynamic class of the receiver object. - * - * The nature of the representation is platform dependent. - * - * @note not specified by SLS as a member of AnyRef - * @return a representation that corresponds to the dynamic class of the receiver object. - */ - def getClass(): Class[_] - /** Wakes up a single thread that is waiting on the receiver object's monitor. * * @note not specified by SLS as a member of AnyRef */ - def notify(): Unit + final def notify(): Unit /** Wakes up all threads that are waiting on the receiver object's monitor. * * @note not specified by SLS as a member of AnyRef */ - def notifyAll(): Unit + final def notifyAll(): Unit /** Causes the current Thread to wait until another Thread invokes * the notify() or notifyAll() methods. * * @note not specified by SLS as a member of AnyRef */ - def wait (): Unit - def wait (timeout: Long, nanos: Int): Unit - def wait (timeout: Long): Unit + final def wait (): Unit + final def wait (timeout: Long, nanos: Int): Unit + final def wait (timeout: Long): Unit } |