diff --git a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala index 6fd02e35604..6d0074aafc2 100644 --- a/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala +++ b/actor-typed/src/main/scala/org/apache/pekko/actor/typed/internal/LoggerClass.scala @@ -58,7 +58,21 @@ private[pekko] object LoggerClass { if (!skip(name)) suitableClass = OptionVal.Some(clazz) idx += 1 } - suitableClass.getOrElse(default) + suitableClass match { + case OptionVal.Some(cls) => + // Fix start + val lambdaClsOwner = for { + nextCaller <- trace.lift(idx) + nextName = nextCaller.getName() + lambdaNameIdx = nextName.indexOf("$$Lambda$") + if nextName.startsWith(cls.getName()) && lambdaNameIdx > 0 + lambdaClsOwner = nextName.substring(0, lambdaNameIdx) + } yield Class.forName(lambdaClsOwner) + // TODO: can potentially guard for ClassNotFoundException, but seems unlikely + lambdaClsOwner.getOrElse(cls) + case _ => + default + } } catch { case NonFatal(_) => default } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index ca1365d4a60..b49fd47268a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -43,7 +43,7 @@ object Dependencies { val scala212Version = "2.12.20" val scala213Version = "2.13.14" - val scala3Version = "3.3.3" + val scala3Version = "3.3.4" val allScalaVersions = Seq(scala213Version, scala212Version, scala3Version) val reactiveStreamsVersion = "1.0.4"