summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-07-01 12:16:49 +0000
committermihaylov <mihaylov@epfl.ch>2005-07-01 12:16:49 +0000
commitb3c92d8d928158b7ae63a39307fd1bec52f440fe (patch)
tree2f33780c901490aa5ea0866fcc5074c146bec9a0 /sources
parented607f9e0045285ac104e336231092c0be4e132c (diff)
downloadscala-b3c92d8d928158b7ae63a39307fd1bec52f440fe.tar.gz
scala-b3c92d8d928158b7ae63a39307fd1bec52f440fe.tar.bz2
scala-b3c92d8d928158b7ae63a39307fd1bec52f440fe.zip
Use scala.runtime.compat.Platform.getClass(obj:...
Use scala.runtime.compat.Platform.getClass(obj: AnyRef) instead of the platform-specific javal.lang.Object.getClass()
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/runtime/ScalaRunTime.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/scala/runtime/ScalaRunTime.scala b/sources/scala/runtime/ScalaRunTime.scala
index b451c5e0f5..9dc7649269 100644
--- a/sources/scala/runtime/ScalaRunTime.scala
+++ b/sources/scala/runtime/ScalaRunTime.scala
@@ -12,6 +12,8 @@ package scala.runtime;
object ScalaRunTime {
+ import compat.Platform.getClass;
+
trait Try[a] {
def Catch[b >: a](handler: PartialFunction[Throwable, b]): b;
def Finally(handler: Unit): a;
@@ -53,7 +55,7 @@ object ScalaRunTime {
}
def _hashCode(x: CaseClass): Int = {
- var code = x.getClass().hashCode();
+ var code = getClass(x).hashCode();
val arity = x.caseArity;
var i = 0;
while (i < arity) {
@@ -65,7 +67,7 @@ object ScalaRunTime {
def _equals(x: CaseClass, y: Any): Boolean = y match {
case y1: CaseClass =>
- (x.getClass() eq y1.getClass()) && {
+ (getClass(x) eq getClass(y1)) && {
val arity = x.caseArity;
var i = 0;
while (i < arity && x.caseElement(i) == y1.caseElement(i))