diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-05-30 09:26:46 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-05-30 09:35:13 +0200 |
commit | 75251f76001d3c781b0630c2061603ebb250a787 (patch) | |
tree | b65e14f6868fc416b6b34eb807d8b318e6c00b4e /test | |
parent | 810a6de757a44d7d481e0ee1bd9c2fb8abe6043d (diff) | |
download | scala-75251f76001d3c781b0630c2061603ebb250a787.tar.gz scala-75251f76001d3c781b0630c2061603ebb250a787.tar.bz2 scala-75251f76001d3c781b0630c2061603ebb250a787.zip |
SI-7532 Fix regression in Java inner classfile reader
395e90a modified the detection of top-level classes in
ClassfileParser in two ways:
1. used `Name#containsChar` rather than `toString.indexOf ...` (good!)
2. decoded the name before doing this check (bad!)
That code is actually only run for non-Scala classfiles, whose
names don't need decoding. Attempting to do so converted `R$attr`
to `R@tr`, which no longer contains a '$', and was wrongly treated
as a top level class.
This commit reverts the use of `decodedName`, and inlines the method
to its only call site for clarity.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t7532/A_1.java | 6 | ||||
-rw-r--r-- | test/files/pos/t7532/B_2.scala | 5 | ||||
-rw-r--r-- | test/files/pos/t7532b/A_1.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t7532b/B_2.scala | 8 |
4 files changed, 26 insertions, 0 deletions
diff --git a/test/files/pos/t7532/A_1.java b/test/files/pos/t7532/A_1.java new file mode 100644 index 0000000000..1ade76cc70 --- /dev/null +++ b/test/files/pos/t7532/A_1.java @@ -0,0 +1,6 @@ +class R { + public class attr { // Will have the bytecode name `R$attr`, not to be confused with `R@tr`! + } + public static class attr1 { + } +} diff --git a/test/files/pos/t7532/B_2.scala b/test/files/pos/t7532/B_2.scala new file mode 100644 index 0000000000..ee7ce7751f --- /dev/null +++ b/test/files/pos/t7532/B_2.scala @@ -0,0 +1,5 @@ +object Test { + val r = new R + new r.attr() // Was: error while loading attr, class file '.../t7532-pos.obj/R$attr.class' has location not matching its contents: contains class + new R.attr1 +}
\ No newline at end of file diff --git a/test/files/pos/t7532b/A_1.scala b/test/files/pos/t7532b/A_1.scala new file mode 100644 index 0000000000..e8f9540609 --- /dev/null +++ b/test/files/pos/t7532b/A_1.scala @@ -0,0 +1,7 @@ +package pack +class R { + class attr // Will have the bytecode name `R$attr`, not to be confused with `R@tr`! + class `@` +} + +class `@`
\ No newline at end of file diff --git a/test/files/pos/t7532b/B_2.scala b/test/files/pos/t7532b/B_2.scala new file mode 100644 index 0000000000..1555a5daa7 --- /dev/null +++ b/test/files/pos/t7532b/B_2.scala @@ -0,0 +1,8 @@ +import pack._ + +object Test { + val r = new R + new r.attr() + new r.`@` + new `@` +}
\ No newline at end of file |