#2217 - setting accessible = true before newInstance

This commit is contained in:
Viktor Klang 2012-06-13 12:23:02 +02:00
parent 8d12385a3e
commit 8ce6ac3e3e
3 changed files with 34 additions and 1 deletions

View file

@ -186,5 +186,9 @@ case class Props(
* able to optimize serialization.
*/
private[akka] case class FromClassCreator(clazz: Class[_ <: Actor]) extends Function0[Actor] {
def apply(): Actor = clazz.newInstance
def apply(): Actor = {
val ctor = clazz.getDeclaredConstructor()
ctor.setAccessible(true)
ctor.newInstance()
}
}