diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-15 08:11:41 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-15 08:11:41 +0000 |
commit | 9f08c98a6e801d4798cb5c3794cab23deb6d9eec (patch) | |
tree | 239d2bde0c2c8b6bf9331387b8549e4be060a6a0 /src/library | |
parent | 69aa78bd1bc593f878e44b2abde61dbb56391204 (diff) | |
download | scala-9f08c98a6e801d4798cb5c3794cab23deb6d9eec.tar.gz scala-9f08c98a6e801d4798cb5c3794cab23deb6d9eec.tar.bz2 scala-9f08c98a6e801d4798cb5c3794cab23deb6d9eec.zip |
Stops barking up the wrong tree with -Ywarn-dea...
Stops barking up the wrong tree with -Ywarn-dead-code. The origin of its
issues was twofold:
1) synchronized acts by-name without being by-name (ticket #4086) 2)
warnings are swallowed if context.reportGeneralErrors is false
Those two plus a dash of bitrot. In any case it's at its all time
happiest now. It found all the dead code related fixes in this commit.
Way to go, -Ywarn-dead-code! Review by odersky.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/io/BytePickle.scala | 4 | ||||
-rw-r--r-- | src/library/scala/mobile/Code.scala | 1 | ||||
-rw-r--r-- | src/library/scala/xml/dtd/Scanner.scala | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/library/scala/io/BytePickle.scala b/src/library/scala/io/BytePickle.scala index 3a51f2e0b8..97e3ff589d 100644 --- a/src/library/scala/io/BytePickle.scala +++ b/src/library/scala/io/BytePickle.scala @@ -144,7 +144,7 @@ object BytePickle { case Ref() => val res2 = unat.appU(res._2) // read location upe.get(res2._1) match { // lookup value in unpickler env - case None => throw new IllegalArgumentException("invalid unpickler environment"); return null + case None => throw new IllegalArgumentException("invalid unpickler environment") case Some(v) => return (v.asInstanceOf[a], new UnPicklerState(res2._2, upe)) } } @@ -153,7 +153,7 @@ object BytePickle { def ulift[t](x: t): PU[t] = new PU[t] { def appP(a: t, state: Array[Byte]): Array[Byte] = - if (x != a) { throw new IllegalArgumentException("value to be pickled (" + a + ") != " + x); state } + if (x != a) throw new IllegalArgumentException("value to be pickled (" + a + ") != " + x) else state; def appU(state: Array[Byte]) = (x, state) } diff --git a/src/library/scala/mobile/Code.scala b/src/library/scala/mobile/Code.scala index 677248aabb..e1d04eafa5 100644 --- a/src/library/scala/mobile/Code.scala +++ b/src/library/scala/mobile/Code.scala @@ -197,7 +197,6 @@ class Code(clazz: java.lang.Class[_]) { cs(0).newInstance("").asInstanceOf[AnyRef] } else { system.error("class " + clazz.getName() + " has no public constructor") - null } } } diff --git a/src/library/scala/xml/dtd/Scanner.scala b/src/library/scala/xml/dtd/Scanner.scala index 0b2daa3284..1ac3c0f24d 100644 --- a/src/library/scala/xml/dtd/Scanner.scala +++ b/src/library/scala/xml/dtd/Scanner.scala @@ -65,7 +65,7 @@ class Scanner extends Tokens with parsing.TokenTests { case ENDCH => END case _ => if (isNameStart(c)) name; // NAME - else { system.error("unexpected character:"+c); END } + else system.error("unexpected character:" + c) } final def name = { |