diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-29 02:59:31 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-29 02:59:31 +0000 |
commit | 5ebbba7a711105d8b6b19ce6497b3dcef0039c6f (patch) | |
tree | 1e625d215c3c5f4bb7ca0bb375f448cbdff1f880 /src/scalap | |
parent | ebedbef6d186c4cc98c9c4445967af43225230dc (diff) | |
download | scala-5ebbba7a711105d8b6b19ce6497b3dcef0039c6f.tar.gz scala-5ebbba7a711105d8b6b19ce6497b3dcef0039c6f.tar.bz2 scala-5ebbba7a711105d8b6b19ce6497b3dcef0039c6f.zip |
Polishing the programmatic interface to the rep...
Polishing the programmatic interface to the repl and other bits
of machinery which we'll have to live with for a while. The repl
classloader now works more like you'd expect a classloader to, as seen
here:
% scala -Dscala.repl.power
scala> class Bippus extends Traversable[Int] { def foreach[U](f: Int => U) = () }
defined class Bippus
scala> intp.classLoader.getResourceAsStream("Bippus").bytes()
res0: Array[Byte] = Array(-54, -2, -70, ...
scala> res0.size
res1: Int = 23954
scala> case class Bippy(x: Int)
defined class Bippy
// classBytes is shorter way to say the same thing scala>
intp.classLoader.classBytes("Bippy").size
res2: Int = 2356
scala> intp.classLoader.classBytes("Bippy$").size
res3: Int = 1741
Closes #4399, no review.
Diffstat (limited to 'src/scalap')
-rw-r--r-- | src/scalap/scala/tools/scalap/Decode.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scalap/scala/tools/scalap/Decode.scala b/src/scalap/scala/tools/scalap/Decode.scala index c8bb58c81e..816041720f 100644 --- a/src/scalap/scala/tools/scalap/Decode.scala +++ b/src/scalap/scala/tools/scalap/Decode.scala @@ -33,7 +33,7 @@ object Decode { */ def scalaSigBytes(name: String): Option[Array[Byte]] = scalaSigBytes(name, getSystemLoader()) def scalaSigBytes(name: String, classLoader: ScalaClassLoader): Option[Array[Byte]] = { - val bytes = classLoader.findBytesForClassName(name) + val bytes = classLoader.classBytes(name) val reader = new ByteArrayReader(bytes) val cf = new Classfile(reader) cf.scalaSigAttribute map (_.data) @@ -43,7 +43,7 @@ object Decode { */ def scalaSigAnnotationBytes(name: String): Option[Array[Byte]] = scalaSigAnnotationBytes(name, getSystemLoader()) def scalaSigAnnotationBytes(name: String, classLoader: ScalaClassLoader): Option[Array[Byte]] = { - val bytes = classLoader.findBytesForClassName(name) + val bytes = classLoader.classBytes(name) val byteCode = ByteCode(bytes) val classFile = ClassFileParser.parse(byteCode) import classFile._ |