diff options
author | Paul Phillips <paulp@improving.org> | 2010-11-30 06:04:33 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-11-30 06:04:33 +0000 |
commit | 402d96dd3fab6ae677966a9a258c00b3f34a37ed (patch) | |
tree | cf7ea182c1d6e3eea2a2b3eb61b123203103e340 /src/compiler | |
parent | 66a92814a61c62149a49335f65f4189763b43296 (diff) | |
download | scala-402d96dd3fab6ae677966a9a258c00b3f34a37ed.tar.gz scala-402d96dd3fab6ae677966a9a258c00b3f34a37ed.tar.bz2 scala-402d96dd3fab6ae677966a9a258c00b3f34a37ed.zip |
It looks like the fix for #2318 was causing pro...
It looks like the fix for #2318 was causing problems, so I gave it some
more graceful failure. Leaving #2318 open because the implementation
could still work harder to find the right method. No review.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 1 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index 4c7bc32c02..a468e81b3e 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -164,6 +164,7 @@ trait Definitions extends reflect.generic.StandardDefinitions { def arrayUpdateMethod = getMember(ScalaRunTimeModule, "array_update") def arrayLengthMethod = getMember(ScalaRunTimeModule, "array_length") def arrayCloneMethod = getMember(ScalaRunTimeModule, "array_clone") + def ensureAccessibleMethod = getMember(ScalaRunTimeModule, "ensureAccessible") def scalaRuntimeHash = getMember(ScalaRunTimeModule, "hash") def scalaRuntimeSameElements = getMember(ScalaRunTimeModule, nme.sameElements) diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 73886420c1..f8f185e6d8 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -221,8 +221,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL { if (method != null) return method else { - method = forReceiver.getMethod("xyz", reflParams$Cache) - method.setAccessible(true) // issue #2381 + method = ScalaRunTime.ensureAccessible(forReceiver.getMethod("xyz", reflParams$Cache)) reflPoly$Cache = new SoftReference(reflPoly$Cache.get.add(forReceiver, method)) return method } @@ -250,8 +249,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL { def methodSymRHS = ((REF(forReceiverSym) DOT Class_getMethod)(LIT(method), REF(reflParamsCacheSym))) def cacheRHS = ((getPolyCache DOT methodCache_add)(REF(forReceiverSym), REF(methodSym))) BLOCK( - REF(methodSym) === methodSymRHS, - (REF(methodSym) DOT methodClass_setAccessible)(LIT(true)), + REF(methodSym) === (REF(ensureAccessibleMethod) APPLY (methodSymRHS)), REF(reflPolyCacheSym) === gen.mkSoftRef(cacheRHS), Return(REF(methodSym)) ) |