File tree 1 file changed +8
-3
lines changed
src/scalap/scala/tools/scalap
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,14 @@ class Main {
97
97
*/
98
98
def process (args : Arguments , path : ClassPath [AbstractFile ])(classname : String ): Unit = {
99
99
// find the classfile
100
- val encName = NameTransformer .encode(
101
- if (classname == " scala.AnyRef" ) " java.lang.Object"
102
- else classname)
100
+ val encName = classname match {
101
+ case " scala.AnyRef" => " java.lang.Object"
102
+ case _ =>
103
+ // we have to encode every fragment of a name separately, otherwise the NameTransformer
104
+ // will encode using unicode escaping dot separators as well
105
+ // we can afford allocations because this is not a performance critical code
106
+ classname.split('.' ).map(NameTransformer .encode).mkString(" ." )
107
+ }
103
108
val cls = path.findClass(encName)
104
109
if (cls.isDefined && cls.get.binary.isDefined) {
105
110
val cfile = cls.get.binary.get
You can’t perform that action at this time.
0 commit comments