This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new c10661e205 refactor: replace deprecated collection aliases in internal
io code (#3467)
c10661e205 is described below
commit c10661e2051e54717207f12c42169d4f8ff9248e
Author: PJ Fanning <[email protected]>
AuthorDate: Tue Aug 25 13:16:40 2026 +0100
refactor: replace deprecated collection aliases in internal io code (#3467)
`GenTraversableOnce` and `immutable.Traversable` are deprecated aliases
for `IterableOnce` and `immutable.Iterable` respectively, kept for the
2.12 migration. Three internal sites still use them, each carrying a
`@nowarn("msg=deprecated")` to suppress the resulting warning:
- Message.parse's `flattener` implicit conversion in DnsMessage
- TcpConnection.completeConnect
- the TcpIncomingConnection constructor
Use the current names and drop the suppressions, which are now stale.
That is the substantive part: an `@nowarn("msg=deprecated")` on a class
or method silences every deprecation warning in its scope, so leaving
them would keep hiding warnings unrelated to the aliases.
All three sites are internal -- `Message` is `private[internal]`, and
`TcpConnection` and `TcpIncomingConnection` are `private[io]` -- so no
public signature changes. The aliases are identical types, so this is
behaviour preserving.
The public API still uses `immutable.Traversable` in Tcp, Udp,
UdpConnected and stream's Tcp. Those are deliberately left alone: the
Scala signature would change, and `Udp.SimpleSender` is a case class, so
`copy` and `unapply` would change with it. They belong in a considered
API change, not here.
---
.../main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
a/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala
b/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala
index a94f0d621c..5a97ea30cd 100644
--- a/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala
+++ b/actor/src/main/scala/org/apache/pekko/io/dns/internal/DnsMessage.scala
@@ -13,8 +13,7 @@
package org.apache.pekko.io.dns.internal
-import scala.annotation.nowarn
-import scala.collection.GenTraversableOnce
+import scala.collection.IterableOnce
import scala.collection.immutable.Seq
import scala.util.{ Failure, Success, Try }
@@ -166,8 +165,7 @@ private[internal] object Message {
}
import scala.language.implicitConversions
- @nowarn("msg=deprecated")
- implicit def flattener[T](tried: Try[T]): GenTraversableOnce[T] =
+ implicit def flattener[T](tried: Try[T]): IterableOnce[T] =
if (flags.isTruncated) tried.toOption
else
tried match {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]