diff --git a/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala b/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala index 2e70ce0d00..c130aed607 100644 --- a/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala +++ b/stream/src/main/scala/org/apache/pekko/stream/impl/PhasedFusingActorMaterializer.scala @@ -686,6 +686,15 @@ private final case class SavedIslandData( */ @InternalApi private[pekko] object GraphStageTag extends IslandTag +/** + * INTERNAL API + */ +@InternalApi +private[pekko] object GraphStageIsland { + // used as a type hint when creating the array of logics + private final val emptyLogicArray = Array.empty[GraphStageLogic] +} + /** * INTERNAL API */ @@ -695,8 +704,6 @@ private final case class SavedIslandData( islandName: String, subflowFuser: OptionVal[GraphInterpreterShell => ActorRef]) extends PhaseIsland[GraphStageLogic] { - // TODO: remove these - private val logicArrayType = Array.empty[GraphStageLogic] private[this] val logics = new util.ArrayList[GraphStageLogic](16) private var connections = new Array[Connection](16) @@ -815,7 +822,7 @@ private final case class SavedIslandData( } shell.connections = finalConnections - shell.logics = logics.toArray(logicArrayType) + shell.logics = logics.toArray(GraphStageIsland.emptyLogicArray) subflowFuser match { case OptionVal.Some(fuseIntoExistingInterpreter) =>