diff options
author | michelou <michelou@epfl.ch> | 2004-09-24 13:00:36 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2004-09-24 13:00:36 +0000 |
commit | 4c98fce60278f602e00ccd14dd017d93aef875b5 (patch) | |
tree | 1cb5d728570da97de2fd37cedccbe875434d98a1 | |
parent | 2dd10de725e3a17e702e94b2332247aea12752e1 (diff) | |
download | scala-4c98fce60278f602e00ccd14dd017d93aef875b5.tar.gz scala-4c98fce60278f602e00ccd14dd017d93aef875b5.tar.bz2 scala-4c98fce60278f602e00ccd14dd017d93aef875b5.zip |
- added missing test in method 'nameToPackage'.
-rw-r--r-- | sources/scala/tools/scalap/JavaWriter.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sources/scala/tools/scalap/JavaWriter.scala b/sources/scala/tools/scalap/JavaWriter.scala index 7fd75d2e2e..37ff3c9412 100644 --- a/sources/scala/tools/scalap/JavaWriter.scala +++ b/sources/scala/tools/scalap/JavaWriter.scala @@ -44,8 +44,11 @@ class JavaWriter(classfile: Classfile, writer: Writer) extends CodeWriter(writer def nameToSimpleClass(str: String) = Names.decode(str.substring(str.lastIndexOf('/') + 1)); - def nameToPackage(str: String) = - Names.decode(str.substring(0, str.lastIndexOf('/')).replace('/', '.')); + def nameToPackage(str: String) = { + val inx = str.lastIndexOf('/'); + val name = if (inx == -1) str else str.substring(0, inx).replace('/', '.'); + Names.decode(name) + } def sigToType(str: String): String = sigToType(str, 0)._1; |