Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updated a few methods for scala 2.10 M3 and updated sbt version
  • Loading branch information
Jesse Eichar committed May 26, 2012
1 parent 8f245e3 commit 510b22a
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion core/src/main/scala/scalax/io/LongTraversableLike.scala
Expand Up @@ -50,6 +50,8 @@ trait LongTraversableLike[+A, +Repr <: LongTraversableLike[A, Repr]] extends Tra
def context:ResourceContext
override protected[this] def thisCollection: LongTraversable[A] = this.asInstanceOf[LongTraversable[A]]
override protected[this] def toCollection(repr: Repr): LongTraversable[A] = repr.asInstanceOf[LongTraversable[A]]

/* TODO fix override
override def toArray[B >: A: ClassManifest] =
if(hasDefiniteSize && size <= Int.MaxValue) {
val array = new Array[B](size.toInt)
Expand All @@ -61,7 +63,7 @@ trait LongTraversableLike[+A, +Repr <: LongTraversableLike[A, Repr]] extends Tra
array
} else {
toBuffer.toArray
}
} */

/**
* Create a processor that provides an API for declaring a processing pipeline of this
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/scala/scalax/io/TraversableOnceOps.scala
Expand Up @@ -16,7 +16,9 @@ private[io] object TraversableOnceOps {
data match {
case t:Traversable[_] => t.asInstanceOf[Traversable[T]].splitAt(index)
case _ =>
def innerSplitAt(iterator:Iterator[T], remaining:Int): (Traversable[Int])
val iter = data.toIterator
splitAt(iter, index)
(iter.take(index).toList,iter)
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/scala/scalax/io/nio/SeekableFileChannel.scala
Expand Up @@ -17,7 +17,8 @@ import java.nio.channels.WritableByteChannel

class SeekableFileChannel(val self : FileChannel) extends SeekableByteChannel with Proxy {
private[this] val wrapped = self
def write (src: java.nio.ByteBuffer) = wrapped.write(src)
def write (src: java.nio.ByteBuffer) =
wrapped.write(src)
def truncate (size: Long) = new SeekableFileChannel(wrapped.truncate(size))
def size = wrapped.size
def read (dst: java.nio.ByteBuffer) = wrapped.read(dst)
Expand Down
Expand Up @@ -45,9 +45,9 @@ protected[io] class ByteResourceTraversable(
override def lsize = {
CloseableIterator.withIterator(iterator,context) {_.size}
}

/* TODO fix override
override def toArray[B >: Byte: ClassManifest]: Array[B] = {
CloseableIterator.withIterator(iterator,context) {_.toArray}
}

*/
}
2 changes: 2 additions & 0 deletions core/src/main/scala/scalax/io/traversable/Sliceable.scala
Expand Up @@ -59,6 +59,7 @@ private[io] abstract class Sliceable extends CloseableIterator[Byte] {
}
}

/* TODO reimplement override when I can
override def toArray[B >: Byte: ClassManifest]: Array[B] = {
init()
val in = getIn
Expand All @@ -81,4 +82,5 @@ private[io] abstract class Sliceable extends CloseableIterator[Byte] {
case _ => throw new IllegalStateException(in.getClass+" is neither a ReadableByteChannel or an InputStream, there is a problem with the implementation because only one of those two should be return by getIn")
}
}
*/
}
2 changes: 1 addition & 1 deletion project/Build.scala
Expand Up @@ -8,7 +8,7 @@ object BuildConstants {
val armVersion = "1.2"
val armScalaVersion = "2.10.0-SNAPSHOT"
val akkaVersion = "2.0.1"
val scalaVersion = "2.10.0-SNAPSHOT"
val scalaVersion = "2.10.0-M3"
}

object ScalaIoBuild extends Build {
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Expand Up @@ -6,3 +6,4 @@ resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"

//addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.0.0")

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0-RC1")
2 changes: 1 addition & 1 deletion sbt
@@ -1 +1 @@
java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -jar `dirname $0`/sbt-launch-0.12-M2.jar "$@"
java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -jar `dirname $0`/sbt-launch-0.11.3.jar "$@"
Binary file renamed sbt-launch-0.12-M2.jar → sbt-launch-0.11.3.jar
Binary file not shown.

0 comments on commit 510b22a

Please sign in to comment.