pjfanning commented on code in PR #3300:
URL: https://github.com/apache/pekko/pull/3300#discussion_r3527516337
##########
actor/src/main/scala/org/apache/pekko/util/Reflect.scala:
##########
@@ -60,11 +61,14 @@ private[pekko] object Reflect {
*/
private[pekko] def instantiate[T](clazz: Class[T]): T = {
val ctor = clazz.getDeclaredConstructor()
- try ctor.newInstance()
- catch {
+ try {
+ val handle = MethodHandles.lookup().unreflectConstructor(ctor)
Review Comment:
cache MethodHandles.lookup() value?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]