diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-11 22:17:17 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-11 22:17:17 +0000 |
commit | 168f8065ea1ca60eae11964078b189cfb04b5578 (patch) | |
tree | de47cb6c52daa409a430e1994519dd2c4d74ad65 /src | |
parent | 4b4acbd819599ca49b61cc1ef46d6cb8e8bf1d0c (diff) | |
download | scala-168f8065ea1ca60eae11964078b189cfb04b5578.tar.gz scala-168f8065ea1ca60eae11964078b189cfb04b5578.tar.bz2 scala-168f8065ea1ca60eae11964078b189cfb04b5578.zip |
Throw different exception.
Booleans aren't numbers. Closes SI-5032, no review.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/immutable/StringLike.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala index d989206a18..42ac5bb23b 100644 --- a/src/library/scala/collection/immutable/StringLike.scala +++ b/src/library/scala/collection/immutable/StringLike.scala @@ -223,10 +223,10 @@ self => if (s != null) s.toLowerCase match { case "true" => true case "false" => false - case _ => throw new NumberFormatException("For input string: \""+s+"\"") + case _ => throw new IllegalArgumentException("For input string: \""+s+"\"") } else - throw new NumberFormatException("For input string: \"null\"") + throw new IllegalArgumentException("For input string: \"null\"") override def toArray[B >: Char : ClassManifest]: Array[B] = toString.toCharArray.asInstanceOf[Array[B]] |