diff options
author | Donna Malayeri <lindydonna@gmail.com> | 2011-03-07 18:08:32 +0000 |
---|---|---|
committer | Donna Malayeri <lindydonna@gmail.com> | 2011-03-07 18:08:32 +0000 |
commit | 3689a29fca753e51d72c6c81abf78dfc6ba51b92 (patch) | |
tree | 4eb40573c7c96a17b72a6b9d4a83e78f270fc93b /src/scalap | |
parent | cb0d585411b0c7336591b4d129b99be2946ba203 (diff) | |
download | scala-3689a29fca753e51d72c6c81abf78dfc6ba51b92.tar.gz scala-3689a29fca753e51d72c6c81abf78dfc6ba51b92.tar.bz2 scala-3689a29fca753e51d72c6c81abf78dfc6ba51b92.zip |
Rename io.Code.toUTF8 and io.Code.fromUTF8 so t...
Rename io.Code.toUTF8 and io.Code.fromUTF8 so that the names match
what the methods do, with an added migration warning. Closes #4203. No
review.
Diffstat (limited to 'src/scalap')
3 files changed, 5 insertions, 5 deletions
diff --git a/src/scalap/scala/tools/scalap/ByteArrayReader.scala b/src/scalap/scala/tools/scalap/ByteArrayReader.scala index c4d06a468c..73220d1048 100644 --- a/src/scalap/scala/tools/scalap/ByteArrayReader.scala +++ b/src/scalap/scala/tools/scalap/ByteArrayReader.scala @@ -72,7 +72,7 @@ class ByteArrayReader(content: Array[Byte]) { /** read an UTF8 encoded string */ def nextUTF8(len: Int): String = { - val cs = scala.io.Codec.toUTF8(buf.slice(bp, bp + len)) + val cs = scala.io.Codec.fromUTF8(buf.slice(bp, bp + len)) bp += len new String(cs) } diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala index 01652a50b9..d53d8e1fc1 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ClassFileParser.scala @@ -64,9 +64,9 @@ class ByteCode(val bytes : Array[Byte], val pos : Int, val length : Int) { * Transforms array subsequence of the current buffer into the UTF8 String and * stores and array of bytes for the decompiler */ - def toUTF8StringAndBytes = { + def fromUTF8StringAndBytes = { val chunk: Array[Byte] = bytes drop pos take length - StringBytesPair(io.Codec.toUTF8(chunk).mkString, chunk) + StringBytesPair(io.Codec.fromUTF8(chunk).mkString, chunk) } def byte(i : Int) = bytes(pos) & 0xFF @@ -102,7 +102,7 @@ object ClassFileParser extends ByteCodeReader { // NOTE currently most constants just evaluate to a string description // TODO evaluate to useful values - val utf8String = (u2 >> bytes) ^^ add1 { raw => pool => raw.toUTF8StringAndBytes } + val utf8String = (u2 >> bytes) ^^ add1 { raw => pool => raw.fromUTF8StringAndBytes } val intConstant = u4 ^^ add1 { x => pool => x } val floatConstant = bytes(4) ^^ add1 { raw => pool => "Float: TODO" } val longConstant = bytes(8) ^^ add2 { raw => pool => raw.toLong } diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala index cb4f336d9c..170a9a15a3 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala @@ -72,7 +72,7 @@ object ScalaSigAttributeParsers extends ByteCodeReader { val symtab = nat >> entry.times val scalaSig = nat ~ nat ~ symtab ^~~^ ScalaSig - val utf8 = read(x => x.toUTF8StringAndBytes.string) + val utf8 = read(x => x.fromUTF8StringAndBytes.string) val longValue = read(_ toLong) } |