From 20e313e6a5d628e5de9bf43d9f3c367d72d257a8 Mon Sep 17 00:00:00 2001 From: Oliver Schulz Date: Sun, 17 Jun 2012 22:22:40 +0200 Subject: [PATCH] Removed final specifier on some ByteString and ByteIterator methods --- .../src/main/scala/akka/util/ByteIterator.scala | 12 ++++++------ akka-actor/src/main/scala/akka/util/ByteString.scala | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/akka-actor/src/main/scala/akka/util/ByteIterator.scala b/akka-actor/src/main/scala/akka/util/ByteIterator.scala index 5de9f5f333..dc5e4a3d5c 100644 --- a/akka-actor/src/main/scala/akka/util/ByteIterator.scala +++ b/akka-actor/src/main/scala/akka/util/ByteIterator.scala @@ -409,7 +409,7 @@ abstract class ByteIterator extends BufferedIterator[Byte] { // the parent class. override def drop(n: Int): this.type = throw new UnsupportedOperationException("Method drop is not implemented in ByteIterator") - final override def slice(from: Int, until: Int): this.type = { + override def slice(from: Int, until: Int): this.type = { if (from > 0) drop(from).take(until - from) else take(until) } @@ -431,16 +431,16 @@ abstract class ByteIterator extends BufferedIterator[Byte] { (this, that) } - final override def indexWhere(p: Byte ⇒ Boolean): Int = { + override def indexWhere(p: Byte ⇒ Boolean): Int = { var index = 0 var found = false while (!found && hasNext) if (p(next())) { found = true } else { index += 1 } if (found) index else -1 } - final def indexOf(elem: Byte): Int = indexWhere { _ == elem } + def indexOf(elem: Byte): Int = indexWhere { _ == elem } - final override def indexOf[B >: Byte](elem: B): Int = indexWhere { _ == elem } + override def indexOf[B >: Byte](elem: B): Int = indexWhere { _ == elem } def toByteString: ByteString @@ -449,13 +449,13 @@ abstract class ByteIterator extends BufferedIterator[Byte] { override def foreach[@specialized U](f: Byte ⇒ U): Unit = while (hasNext) f(next()) - final override def foldLeft[@specialized B](z: B)(op: (B, Byte) ⇒ B): B = { + override def foldLeft[@specialized B](z: B)(op: (B, Byte) ⇒ B): B = { var acc = z foreach { byte ⇒ acc = op(acc, byte) } acc } - final override def toArray[B >: Byte](implicit arg0: ClassManifest[B]): Array[B] = { + override def toArray[B >: Byte](implicit arg0: ClassManifest[B]): Array[B] = { val target = Array.ofDim[B](len) copyToArray(target) target diff --git a/akka-actor/src/main/scala/akka/util/ByteString.scala b/akka-actor/src/main/scala/akka/util/ByteString.scala index 714075c6e8..b0dc19d49f 100644 --- a/akka-actor/src/main/scala/akka/util/ByteString.scala +++ b/akka-actor/src/main/scala/akka/util/ByteString.scala @@ -285,7 +285,7 @@ sealed abstract class ByteString extends IndexedSeq[Byte] with IndexedSeqOptimiz override def copyToArray[B >: Byte](xs: Array[B], start: Int, len: Int): Unit = iterator.copyToArray(xs, start, len) - @inline final override def foreach[@specialized U](f: Byte ⇒ U): Unit = iterator foreach f + override def foreach[@specialized U](f: Byte ⇒ U): Unit = iterator foreach f /** * Efficiently concatenate another ByteString. @@ -327,7 +327,7 @@ sealed abstract class ByteString extends IndexedSeq[Byte] with IndexedSeqOptimiz * Creates a new ByteBuffer with a copy of all bytes contained in this * ByteString. */ - final def toByteBuffer: ByteBuffer = ByteBuffer.wrap(toArray) + def toByteBuffer: ByteBuffer = ByteBuffer.wrap(toArray) /** * Decodes this ByteString as a UTF-8 encoded String.