diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-08-03 18:28:03 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-08-03 18:37:15 +0200 |
commit | ce4bcb536279d97617f85da3f66b5296c6ee2b96 (patch) | |
tree | eb4c866d243dbfae9f5bec6656f8913e5ed774bf /build.xml | |
parent | 57fcda5cc5407b33d638f3c4d7c4f41a92fceac4 (diff) | |
download | scala-ce4bcb536279d97617f85da3f66b5296c6ee2b96.tar.gz scala-ce4bcb536279d97617f85da3f66b5296c6ee2b96.tar.bz2 scala-ce4bcb536279d97617f85da3f66b5296c6ee2b96.zip |
SI-6175 reflect over classes with symbolic names
Top-level classes with symbolic names (having binary names like $colon$colon)
have previously been incorrectly treated as local classes by Scala reflection.
As a result they were loaded as if they weren't pickled (i.e. as Java classes).
Moreover this bug also had a more subtle, but more dangerous manifestation.
If such a class has already been loaded indirectly by unpickling another class
(which refers to it in its pickle) and then someone tried to load it explicitly
via classToScala, then it would be loaded twice (once as a Scala artifact and
once as a Java artifact). This is a short route to ambiguities and crashes.
The fix first checks whether a class with a suspicious name (having dollars)
can be loaded as a Scala artifact (by looking it up in a symbol table).
If this fails, the class is then loaded in Java style (as it was done before).
Ambiguous names that can be interpreted both ways (e.g. foo_$colon$colon)
are first resolved as Scala and then as Java. This prioritization cannot lead
to errors, because Scala and Java artifacts with the same name cannot coexist,
therefore loading a Scala artifact won't shadow a homonymous Java artifact.
Diffstat (limited to 'build.xml')
0 files changed, 0 insertions, 0 deletions