summaryrefslogtreecommitdiff
path: root/test/osgi/src
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-24 15:09:50 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-24 15:09:50 +0200
commit759de8623923d17eaca373dcec14899681a52df4 (patch)
tree58a0a53e205828bb65c9ac6037f414c05e1465e5 /test/osgi/src
parentb403c1d7524ccdfc3455b5bc5d5363fdd9c82bec (diff)
downloadscala-759de8623923d17eaca373dcec14899681a52df4.tar.gz
scala-759de8623923d17eaca373dcec14899681a52df4.tar.bz2
scala-759de8623923d17eaca373dcec14899681a52df4.zip
fixes mirrorThatLoaded in JavaMirrors
`mirrorThatLoaded(sym: Symbol): Mirror` in JavaMirrors used to iterate over `lazy val mirrors = new WeakHashMap[ClassLoader, WeakReference[JavaMirror]]()` to find out what mirror has loaded a certain symbol. It worked okay until yesterday when I noticed failing tests, which crashed when weak references in mirrors were dereferenced with get.get. Apparently some mirrors were collected, and the logic in JavaMirror didn't account for that possibility. When fixing this bug, I noticed that mirrors can become unreachable even if there are still reachable symbols created by those mirrors. That doesn't make sense, therefore I fixed this bug as well by introducing a strong ref from root symbols to the enclosing mirror. Therefore, any active symbol will have a strong reference to the enclosing mirror by the virtue of the owner chain.
Diffstat (limited to 'test/osgi/src')
0 files changed, 0 insertions, 0 deletions