summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-03-15 12:44:32 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-03-15 12:44:32 +0000
commitfc6b3b0c6235540ffb244f8245ee1da37171de78 (patch)
tree8c1d12cd60a75dc895a750ded51ce00e4724e763
parent2f0a415e1fd1ed856808238e288039b5909b6cbe (diff)
downloadscala-fc6b3b0c6235540ffb244f8245ee1da37171de78.tar.gz
scala-fc6b3b0c6235540ffb244f8245ee1da37171de78.tar.bz2
scala-fc6b3b0c6235540ffb244f8245ee1da37171de78.zip
Fixes #3086. Review by community.
-rw-r--r--src/library/scala/LowPriorityImplicits.scala26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/library/scala/LowPriorityImplicits.scala b/src/library/scala/LowPriorityImplicits.scala
index d5a3727f66..27f952c8ca 100644
--- a/src/library/scala/LowPriorityImplicits.scala
+++ b/src/library/scala/LowPriorityImplicits.scala
@@ -26,21 +26,21 @@ import collection.generic.CanBuildFrom
class LowPriorityImplicits {
implicit def genericWrapArray[T](xs: Array[T]): WrappedArray[T] =
- WrappedArray.make(xs)
+ if (xs != null) WrappedArray.make(xs) else null
- implicit def wrapRefArray[T <: AnyRef](xs: Array[T]): WrappedArray[T] = new WrappedArray.ofRef[T](xs)
- implicit def wrapIntArray(xs: Array[Int]): WrappedArray[Int] = new WrappedArray.ofInt(xs)
- implicit def wrapDoubleArray(xs: Array[Double]): WrappedArray[Double] = new WrappedArray.ofDouble(xs)
- implicit def wrapLongArray(xs: Array[Long]): WrappedArray[Long] = new WrappedArray.ofLong(xs)
- implicit def wrapFloatArray(xs: Array[Float]): WrappedArray[Float] = new WrappedArray.ofFloat(xs)
- implicit def wrapCharArray(xs: Array[Char]): WrappedArray[Char] = new WrappedArray.ofChar(xs)
- implicit def wrapByteArray(xs: Array[Byte]): WrappedArray[Byte] = new WrappedArray.ofByte(xs)
- implicit def wrapShortArray(xs: Array[Short]): WrappedArray[Short] = new WrappedArray.ofShort(xs)
- implicit def wrapBooleanArray(xs: Array[Boolean]): WrappedArray[Boolean] = new WrappedArray.ofBoolean(xs)
- implicit def wrapUnitArray(xs: Array[Unit]): WrappedArray[Unit] = new WrappedArray.ofUnit(xs)
+ implicit def wrapRefArray[T <: AnyRef](xs: Array[T]): WrappedArray[T] = if (xs != null) new WrappedArray.ofRef[T](xs) else null
+ implicit def wrapIntArray(xs: Array[Int]): WrappedArray[Int] = if (xs != null) new WrappedArray.ofInt(xs) else null
+ implicit def wrapDoubleArray(xs: Array[Double]): WrappedArray[Double] = if (xs != null) new WrappedArray.ofDouble(xs) else null
+ implicit def wrapLongArray(xs: Array[Long]): WrappedArray[Long] = if (xs != null) new WrappedArray.ofLong(xs) else null
+ implicit def wrapFloatArray(xs: Array[Float]): WrappedArray[Float] = if (xs != null) new WrappedArray.ofFloat(xs) else null
+ implicit def wrapCharArray(xs: Array[Char]): WrappedArray[Char] = if (xs != null) new WrappedArray.ofChar(xs) else null
+ implicit def wrapByteArray(xs: Array[Byte]): WrappedArray[Byte] = if (xs != null) new WrappedArray.ofByte(xs) else null
+ implicit def wrapShortArray(xs: Array[Short]): WrappedArray[Short] = if (xs != null) new WrappedArray.ofShort(xs) else null
+ implicit def wrapBooleanArray(xs: Array[Boolean]): WrappedArray[Boolean] = if (xs != null) new WrappedArray.ofBoolean(xs) else null
+ implicit def wrapUnitArray(xs: Array[Unit]): WrappedArray[Unit] = if (xs != null) new WrappedArray.ofUnit(xs) else null
- implicit def wrapString(s: String): WrappedString = new WrappedString(s)
- implicit def unwrapString(ws: WrappedString): String = ws.self
+ implicit def wrapString(s: String): WrappedString = if (s != null) new WrappedString(s) else null
+ implicit def unwrapString(ws: WrappedString): String = if (ws != null) ws.self else null
implicit def fallbackStringCanBuildFrom[T]: CanBuildFrom[String, T, collection.immutable.IndexedSeq[T]] =
new CanBuildFrom[String, T, collection.immutable.IndexedSeq[T]] {