Removing potential race condition in reflective cycle breaking stuff

This commit is contained in:
Viktor Klang 2011-11-14 11:24:06 +01:00
parent 86af46fb6c
commit 0307a655d3

View file

@ -403,10 +403,8 @@ private[akka] class ActorCell(
def lookupAndSetField(clazz: Class[_], actor: Actor, name: String, value: Any): Boolean = {
val success = try {
val field = clazz.getDeclaredField(name)
val was = field.isAccessible
field.setAccessible(true)
field.set(actor, value)
field.setAccessible(was)
true
} catch {
case e: NoSuchFieldException false