summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-03-08 09:30:58 +0000
committerschinz <schinz@epfl.ch>2005-03-08 09:30:58 +0000
commit2f69f39176bec1a8bfc0b53fcc3ce1be640d6def (patch)
treede9f8a3f6b50735cb6eba9624a24e9beed510b1c
parentaa77b6d1ec06bcec09d360b9032b90a023d10c4e (diff)
downloadscala-2f69f39176bec1a8bfc0b53fcc3ce1be640d6def.tar.gz
scala-2f69f39176bec1a8bfc0b53fcc3ce1be640d6def.tar.bz2
scala-2f69f39176bec1a8bfc0b53fcc3ce1be640d6def.zip
- fixed view methods to avoid NPEs when the wra...
- fixed view methods to avoid NPEs when the wrapped object itself is null.
-rw-r--r--sources/scala/Predef.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/scala/Predef.scala b/sources/scala/Predef.scala
index 938b27a59b..c29d751a7d 100644
--- a/sources/scala/Predef.scala
+++ b/sources/scala/Predef.scala
@@ -284,7 +284,7 @@ object Predef {
def elements = Iterator.fromArray(xs);
def apply(n: Int) = xs(n);
override def hashCode(): Int = xs.hashCode();
- override def equals(y: Any): Boolean = xs.equals(y);
+ override def equals(y: Any): Boolean = (xs == y);
override protected def stringPrefix: String = "Array";
}
@@ -293,7 +293,7 @@ object Predef {
def elements = Iterator.fromString(str);
def apply(n: Int) = str.charAt(n);
override def hashCode(): Int = str.hashCode();
- override def equals(y: Any): Boolean = str.equals(y);
+ override def equals(y: Any): Boolean = (str == y);
override protected def stringPrefix: String = "String";
}
}