diff --git a/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala b/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala index 70e500dadc..0d88054317 100644 --- a/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala +++ b/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala @@ -1919,12 +1919,6 @@ object RunnableGraph { if (newRunnable eq runnable) this else new RunnableGraphAdapter(newRunnable) } - - override def named(name: String): RunnableGraphAdapter[Mat] = { - val newRunnable = runnable.named(name) - if (newRunnable eq runnable) this - else new RunnableGraphAdapter(newRunnable) - } } } /** @@ -1942,4 +1936,12 @@ abstract class RunnableGraph[+Mat] extends Graph[ClosedShape, Mat] { * Transform only the materialized value of this RunnableGraph, leaving all other properties as they were. */ def mapMaterializedValue[Mat2](f: function.Function[Mat, Mat2]): RunnableGraph[Mat2] + + override def withAttributes(attr: Attributes): RunnableGraph[Mat] + + override def addAttributes(attr: Attributes): RunnableGraph[Mat] = + withAttributes(module.attributes and attr) + + override def named(name: String): RunnableGraph[Mat] = + withAttributes(Attributes.name(name)) } diff --git a/akka-stream/src/main/scala/akka/stream/scaladsl/Flow.scala b/akka-stream/src/main/scala/akka/stream/scaladsl/Flow.scala index c0ee5ef4e0..de56a2966f 100644 --- a/akka-stream/src/main/scala/akka/stream/scaladsl/Flow.scala +++ b/akka-stream/src/main/scala/akka/stream/scaladsl/Flow.scala @@ -350,6 +350,9 @@ final case class RunnableGraph[+Mat](val module: StreamLayout.Module) extends Gr */ def run()(implicit materializer: Materializer): Mat = materializer.materialize(this) + override def addAttributes(attr: Attributes): RunnableGraph[Mat] = + withAttributes(module.attributes and attr) + override def withAttributes(attr: Attributes): RunnableGraph[Mat] = new RunnableGraph(module.withAttributes(attr)) diff --git a/project/MiMa.scala b/project/MiMa.scala index dcc7d1b396..07112a6c53 100644 --- a/project/MiMa.scala +++ b/project/MiMa.scala @@ -927,7 +927,11 @@ object MiMa extends AutoPlugin { // # ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.javadsl.model.HttpEntity.discardBytes"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.scaladsl.model.HttpEntity.discardBytes") + ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.http.scaladsl.model.HttpEntity.discardBytes"), + + // #20630 corrected return types of java methods + ProblemFilters.exclude[IncompatibleResultTypeProblem]("akka.stream.javadsl.RunnableGraph#RunnableGraphAdapter.named"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("akka.stream.javadsl.RunnableGraph.withAttributes") ) ) }