Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use convertIterable to wrap java Iterables #613

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public static MediaType.Binary applicationBinary(
: org.apache.pekko.http.scaladsl.model.MediaType.NotCompressible$.MODULE$;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.applicationBinary(subType, comp, fileEx);
}
Expand All @@ -478,7 +478,7 @@ public static MediaType.Binary applicationBinary(
(org.apache.pekko.http.scaladsl.model.MediaType.Compressibility) compressibility;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.applicationBinary(subType, comp, fileEx);
}
Expand All @@ -489,7 +489,7 @@ public static MediaType.WithFixedCharset applicationWithFixedCharset(
(org.apache.pekko.http.scaladsl.model.HttpCharset) charset;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.applicationWithFixedCharset(
subType, cs, fileEx);
Expand All @@ -498,7 +498,7 @@ public static MediaType.WithFixedCharset applicationWithFixedCharset(
public static MediaType.WithOpenCharset applicationWithOpenCharset(
String subType, String... fileExtensions) {
scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.applicationWithOpenCharset(
subType, fileEx);
Expand All @@ -512,7 +512,7 @@ public static MediaType.Binary audio(
: org.apache.pekko.http.scaladsl.model.MediaType.NotCompressible$.MODULE$;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.audio(subType, comp, fileEx);
}
Expand All @@ -523,7 +523,7 @@ public static MediaType.Binary audio(
(org.apache.pekko.http.scaladsl.model.MediaType.Compressibility) compressibility;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.audio(subType, comp, fileEx);
}
Expand All @@ -536,7 +536,7 @@ public static MediaType.Binary image(
: org.apache.pekko.http.scaladsl.model.MediaType.NotCompressible$.MODULE$;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.image(subType, comp, fileEx);
}
Expand All @@ -547,7 +547,7 @@ public static MediaType.Binary image(
(org.apache.pekko.http.scaladsl.model.MediaType.Compressibility) compressibility;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.image(subType, comp, fileEx);
}
Expand All @@ -560,7 +560,7 @@ public static MediaType.Binary message(
: org.apache.pekko.http.scaladsl.model.MediaType.NotCompressible$.MODULE$;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.message(subType, comp, fileEx);
}
Expand All @@ -571,14 +571,14 @@ public static MediaType.Binary message(
(org.apache.pekko.http.scaladsl.model.MediaType.Compressibility) compressibility;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.message(subType, comp, fileEx);
}

public static MediaType.WithOpenCharset text(String subType, String... fileExtensions) {
scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.text(subType, fileEx);
}
Expand All @@ -591,7 +591,7 @@ public static MediaType.Binary video(
: org.apache.pekko.http.scaladsl.model.MediaType.NotCompressible$.MODULE$;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.video(subType, comp, fileEx);
}
Expand All @@ -602,7 +602,7 @@ public static MediaType.Binary video(
(org.apache.pekko.http.scaladsl.model.MediaType.Compressibility) compressibility;

scala.collection.immutable.Seq<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions));
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions));

return org.apache.pekko.http.scaladsl.model.MediaType.video(subType, comp, fileEx);
}
Expand Down Expand Up @@ -638,8 +638,7 @@ public static MediaType.Binary customBinary(
: org.apache.pekko.http.scaladsl.model.MediaType.NotCompressible$.MODULE$;

scala.collection.immutable.List<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions))
.toList();
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions)).toList();

scala.collection.immutable.Map<String, String> p = Util.convertMapToScala(params);

Expand All @@ -658,8 +657,7 @@ public static MediaType.Binary customBinary(
(org.apache.pekko.http.scaladsl.model.MediaType.Compressibility) compressibility;

scala.collection.immutable.List<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions))
.toList();
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions)).toList();

scala.collection.immutable.Map<String, String> p = Util.convertMapToScala(params);

Expand All @@ -678,8 +676,7 @@ public static MediaType.WithFixedCharset customWithFixedCharset(
(org.apache.pekko.http.scaladsl.model.HttpCharset) charset;

scala.collection.immutable.List<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions))
.toList();
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions)).toList();

scala.collection.immutable.Map<String, String> p = Util.convertMapToScala(params);

Expand All @@ -694,8 +691,7 @@ public static MediaType.WithOpenCharset customWithOpenCharset(
boolean allowArbitrarySubtypes,
String... fileExtensions) {
scala.collection.immutable.List<String> fileEx =
org.apache.pekko.japi.Util.<String>immutableSeq(java.util.Arrays.asList(fileExtensions))
.toList();
Util.<String, String>convertIterable(java.util.Arrays.asList(fileExtensions)).toList();

scala.collection.immutable.Map<String, String> p = Util.convertMapToScala(params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import org.apache.pekko
import pekko.annotation.{ ApiMayChange, DoNotInherit }
import pekko.http.impl.util.Util
import pekko.http.scaladsl
import pekko.japi.Util
import pekko.stream.TLSClientAuth
import pekko.util.OptionConverters._
import com.typesafe.sslconfig.pekko.PekkoSSLConfig
Expand Down Expand Up @@ -60,14 +60,14 @@

// ConnectionContext
/** Used to serve HTTPS traffic. */
@Deprecated @deprecated("use httpsServer, httpsClient or the method that takes a custom factory",

Check warning on line 63 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 63 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 63 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
since = "Akka HTTP 10.2.0")
def https(sslContext: SSLContext): HttpsConnectionContext = // ...
// #https-context-creation
scaladsl.ConnectionContext.https(sslContext)

/** Used to serve HTTPS traffic. */
@Deprecated @deprecated("use httpsServer, httpsClient or the method that takes a custom factory",

Check warning on line 70 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 70 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 70 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
since = "Akka HTTP 10.2.0")
def https(
sslContext: SSLContext,
Expand All @@ -80,13 +80,13 @@
scaladsl.ConnectionContext.https(
sslContext,
sslConfig.toScala,
enabledCipherSuites.toScala.map(Util.immutableSeq(_)),
enabledProtocols.toScala.map(Util.immutableSeq(_)),
enabledCipherSuites.toScala.map(Util.convertIterable[String, String](_)),
enabledProtocols.toScala.map(Util.convertIterable[String, String](_)),
clientAuth.toScala,
sslParameters.toScala)

/** Used to serve HTTPS traffic. */
@Deprecated @deprecated("use httpsServer, httpsClient or the method that takes a custom factory",

Check warning on line 89 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 89 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 89 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
since = "Akka HTTP 10.2.0")
def https(
sslContext: SSLContext,
Expand All @@ -97,8 +97,8 @@
scaladsl.ConnectionContext.https(
sslContext,
None,
enabledCipherSuites.toScala.map(Util.immutableSeq(_)),
enabledProtocols.toScala.map(Util.immutableSeq(_)),
enabledCipherSuites.toScala.map(Util.convertIterable[String, String](_)),
enabledProtocols.toScala.map(Util.convertIterable[String, String](_)),
clientAuth.toScala,
sslParameters.toScala)

Expand All @@ -110,7 +110,7 @@
@DoNotInherit
abstract class ConnectionContext {
def isSecure: Boolean
@Deprecated

Check warning on line 113 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 113 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 113 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
@deprecated("Not always available", since = "Akka HTTP 10.2.0")
def sslConfig: Option[PekkoSSLConfig]
}
Expand All @@ -126,19 +126,19 @@
override final def isSecure = true

/** Java API */
@Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")

Check warning on line 129 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 129 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 129 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
def getEnabledCipherSuites: Optional[JCollection[String]]

/** Java API */
@Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")

Check warning on line 133 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 133 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")

Check warning on line 133 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
def getEnabledProtocols: Optional[JCollection[String]]

/** Java API */
@Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")

Check warning on line 137 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
def getClientAuth: Optional[TLSClientAuth]

/** Java API */
@Deprecated @deprecated("here for binary compatibility, not always available", since = "Akka HTTP 10.2.0")

Check warning on line 141 in http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala

View workflow job for this annotation

GitHub Actions / validate-links

Prefer the Scala annotation over Java's `@Deprecated` to provide a message and version: @deprecated("message", since = "MyLib 1.0")
def getSslContext: SSLContext

/** Java API */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import java.lang.{ Iterable => JIterable }

import pekko.annotation.DoNotInherit
import pekko.http.scaladsl
import pekko.japi.Util
import pekko.http.impl.util.Util
import pekko.pattern.CircuitBreakerOpenException
import pekko.util.OptionConverters._

Expand Down Expand Up @@ -416,7 +416,8 @@ object Rejections {
s.UnsupportedRequestEncodingRejection(supported.asScala)

def unsatisfiableRange(unsatisfiableRanges: java.lang.Iterable[ByteRange], actualEntityLength: Long) =
UnsatisfiableRangeRejection(Util.immutableSeq(unsatisfiableRanges).map(_.asScala), actualEntityLength)
UnsatisfiableRangeRejection(Util.convertIterable[ByteRange, ByteRange](unsatisfiableRanges).map(_.asScala),
actualEntityLength)

def tooManyRanges(maxRanges: Int) = TooManyRangesRejection(maxRanges)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ trait Rejected extends RouteResult {

object RouteResults {
import pekko.http.scaladsl.{ server => s }
import pekko.japi.Util
import pekko.http.impl.util.JavaMapping
import pekko.http.impl.util.{ JavaMapping, Util }
import JavaMapping.Implicits._
import RoutingJavaMapping._

Expand All @@ -38,7 +37,7 @@ object RouteResults {
}

def rejected(rejections: java.lang.Iterable[Rejection]): Rejected = {
s.RouteResult.Rejected(Util.immutableSeq(rejections).map(_.asScala))
s.RouteResult.Rejected(Util.convertIterable[Rejection, Rejection](rejections).map(_.asScala))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,36 @@ import java.util.function.{ Function => JFunction }

import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.http.impl.util.JavaMapping
import pekko.http.javadsl.settings.ParserSettings
import pekko.http.javadsl.settings.RoutingSettings
import pekko.dispatch.ExecutionContexts
import pekko.event.LoggingAdapter
import pekko.japi.Util
import pekko.stream.Materializer
import pekko.stream.javadsl.Source
import pekko.util.ByteString
import pekko.util.FutureConverters._

import scala.concurrent.ExecutionContextExecutor
import pekko.http.impl.model.JavaUri
import pekko.http.javadsl.model.HttpRequest
import pekko.http.javadsl.model.HttpEntity
import pekko.http.javadsl.model.RequestEntity
import pekko.http.javadsl.model.Uri
import pekko.http.impl.util.JavaMapping
import pekko.http.impl.util.Util.convertIterable
import pekko.http.javadsl.model.{ HttpEntity, HttpRequest, RequestEntity, Uri }
import pekko.http.javadsl.server._
import pekko.http.scaladsl.server.{ Directives => D }
import pekko.http.javadsl.settings.{ ParserSettings, RoutingSettings }
import pekko.http.scaladsl
import pekko.stream.Materializer
import java.util.function.Supplier
import java.util.{ List => JList }
import pekko.http.scaladsl.server.{ Directives => D }

import pekko.http.javadsl.model.HttpResponse
import pekko.http.javadsl.model.ResponseEntity
import pekko.http.javadsl.model.HttpHeader
import pekko.http.scaladsl.util.FastFuture._
import pekko.http.javadsl.server

import java.lang.{ Iterable => JIterable }
import java.util.function.Supplier
import java.util.{ List => JList }
import java.util.concurrent.CompletionStage
import java.util.function.Predicate

import pekko.dispatch.ExecutionContexts
import pekko.event.LoggingAdapter
import pekko.http.javadsl.server
import pekko.util.FutureConverters._

import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.FiniteDuration

abstract class BasicDirectives {
Expand All @@ -66,7 +63,8 @@ abstract class BasicDirectives {

def mapRejections(f: JFunction[JList[Rejection], JList[Rejection]], inner: Supplier[Route]): Route = RouteAdapter {
D.mapRejections(rejections =>
Util.immutableSeq(f.apply(Util.javaArrayList(rejections.map(_.asJava)))).map(_.asScala)) { inner.get.delegate }
convertIterable[Rejection, Rejection](f.apply(Util.javaArrayList(rejections.map(_.asJava)))).map(
_.asScala)) { inner.get.delegate }
}

def mapResponse(f: JFunction[HttpResponse, HttpResponse], inner: Supplier[Route]): Route = RouteAdapter {
Expand All @@ -79,7 +77,10 @@ abstract class BasicDirectives {

def mapResponseHeaders(f: JFunction[JList[HttpHeader], JList[HttpHeader]], inner: Supplier[Route]): Route =
RouteAdapter {
D.mapResponseHeaders(l => Util.immutableSeq(f.apply(Util.javaArrayList(l))).map(_.asScala)) { inner.get.delegate } // TODO try to remove map()
D.mapResponseHeaders(l =>
convertIterable[HttpHeader, HttpHeader](f.apply(Util.javaArrayList(l))).map(_.asScala)) {
inner.get.delegate
} // TODO try to remove map()
}

def mapInnerRoute(f: JFunction[Route, Route], inner: Supplier[Route]): Route = RouteAdapter {
Expand Down Expand Up @@ -155,7 +156,7 @@ abstract class BasicDirectives {
* to the list of rejections potentially coming back from the inner route.
*/
def cancelRejections(classes: JIterable[Class[_]], inner: Supplier[Route]): Route = RouteAdapter {
D.cancelRejections(Util.immutableSeq(classes): _*) { inner.get.delegate }
D.cancelRejections(convertIterable[Class[_], Class[_]](classes): _*) { inner.get.delegate }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import java.util.Optional
import java.util.function.Function

import org.apache.pekko
import pekko.japi.Util
import pekko.http.impl.util.Util
import pekko.http.scaladsl.model._
import pekko.http.scaladsl.model.headers.{ ByteRange, HttpChallenge, HttpEncoding }
import pekko.http.javadsl.{ model, server => jserver }
Expand Down Expand Up @@ -335,7 +335,9 @@ final case class TransformationRejection(transform: immutable.Seq[Rejection] =>
override def apply(t: Iterable[jserver.Rejection]): Iterable[jserver.Rejection] = {
// explicit collects assignment is because of unidoc failing compilation on .asScala and .asJava here
val transformed: Seq[jserver.Rejection] =
transform(Util.immutableSeq(t).collect { case r: Rejection => r }).collect { case j: jserver.Rejection => j }
transform(Util.convertIterable[jserver.Rejection, jserver.Rejection](t).collect { case r: Rejection =>
r
}).collect { case j: jserver.Rejection => j }
transformed.asJava // TODO "asJavaDeep" and optimise?
}
}
Expand Down
Loading