File tree Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Expand file tree Collapse file tree 2 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ abstract class Any {
77
77
*
78
78
* @return a class object corresponding to the runtime type of the receiver.
79
79
*/
80
- def getClass (): Class [_]
80
+ final def getClass (): Class [_] = sys.error( " getClass " )
81
81
82
82
/** Test two objects for equality.
83
83
* The expression `x == that` is equivalent to `if (x eq null) that eq null else x.equals(that)`.
@@ -116,7 +116,7 @@ abstract class Any {
116
116
*
117
117
* @return `true` if the receiver object is an instance of erasure of type `T0`; `false` otherwise.
118
118
*/
119
- def isInstanceOf [T0 ]: Boolean = sys.error(" isInstanceOf" )
119
+ final def isInstanceOf [T0 ]: Boolean = sys.error(" isInstanceOf" )
120
120
121
121
/** Cast the receiver object to be of type `T0`.
122
122
*
@@ -129,5 +129,5 @@ abstract class Any {
129
129
* @throws ClassCastException if the receiver object is not an instance of the erasure of type `T0`.
130
130
* @return the receiver object.
131
131
*/
132
- def asInstanceOf [T0 ]: T0 = sys.error(" asInstanceOf" )
132
+ final def asInstanceOf [T0 ]: T0 = sys.error(" asInstanceOf" )
133
133
}
Original file line number Diff line number Diff line change @@ -100,33 +100,24 @@ trait AnyRef extends Any {
100
100
*/
101
101
protected def finalize (): Unit
102
102
103
- /** A representation that corresponds to the dynamic class of the receiver object.
104
- *
105
- * The nature of the representation is platform dependent.
106
- *
107
- * @note not specified by SLS as a member of AnyRef
108
- * @return a representation that corresponds to the dynamic class of the receiver object.
109
- */
110
- def getClass (): Class [_]
111
-
112
103
/** Wakes up a single thread that is waiting on the receiver object's monitor.
113
104
*
114
105
* @note not specified by SLS as a member of AnyRef
115
106
*/
116
- def notify (): Unit
107
+ final def notify (): Unit
117
108
118
109
/** Wakes up all threads that are waiting on the receiver object's monitor.
119
110
*
120
111
* @note not specified by SLS as a member of AnyRef
121
112
*/
122
- def notifyAll (): Unit
113
+ final def notifyAll (): Unit
123
114
124
115
/** Causes the current Thread to wait until another Thread invokes
125
116
* the notify() or notifyAll() methods.
126
117
*
127
118
* @note not specified by SLS as a member of AnyRef
128
119
*/
129
- def wait (): Unit
130
- def wait (timeout : Long , nanos : Int ): Unit
131
- def wait (timeout : Long ): Unit
120
+ final def wait (): Unit
121
+ final def wait (timeout : Long , nanos : Int ): Unit
122
+ final def wait (timeout : Long ): Unit
132
123
}
You can’t perform that action at this time.
0 commit comments