Skip to content

Commit

Permalink
Fix type parameters in Java API to work with latest Akka #1952 (#1965)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren authored and ktoso committed Mar 27, 2018
1 parent 16c9add commit 6a8eb6b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static Multipart.FormData createFormDataFromParts(Multipart.FormData.Body
* Constructor for `multipart/form-data` content as defined in http://tools.ietf.org/html/rfc2388.
* All parts must have distinct names. (This is not verified!)
*/
public static Multipart.FormData createFormDataFromSourceParts(Source<Multipart.FormData.BodyPart, Object> parts) {
public static Multipart.FormData createFormDataFromSourceParts(Source<Multipart.FormData.BodyPart, ? extends Object> parts) {
return akka.http.scaladsl.model.Multipart.FormData$.MODULE$.createSource(parts.asScala());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ object Multipart {

/** Java API */
override def getParts: JSource[jm.Multipart.General.BodyPart.Strict, AnyRef] =
super.getParts.asInstanceOf[JSource[_ <: jm.Multipart.General.BodyPart.Strict, AnyRef]]
super.getParts.asInstanceOf[JSource[jm.Multipart.General.BodyPart.Strict, AnyRef]]

/** Java API */
override def getStrictParts: java.lang.Iterable[jm.Multipart.General.BodyPart.Strict] =
Expand Down Expand Up @@ -361,7 +361,7 @@ object Multipart {
}
/** INTERNAL API */
@InternalApi
private[akka] def createSource(parts: Source[akka.http.javadsl.model.Multipart.FormData.BodyPart, Any]): Multipart.FormData = {
private[akka] def createSource(parts: Source[akka.http.javadsl.model.Multipart.FormData.BodyPart, _]): Multipart.FormData = {
apply(parts.asInstanceOf[Source[Multipart.FormData.BodyPart, Any]])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import scala.concurrent.duration._
*/
class WSProbe(delegate: st.WSProbe) {

def flow: Flow[Message, Message, Any] = {
def flow: Flow[Message, Message, NotUsed] = {
val underlying = scaladsl.Flow[Message].map(_.asScala).via(delegate.flow).map(_.asJava)
new Flow[Message, Message, NotUsed](underlying)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import akka.stream.{ Materializer, scaladsl }

trait WSTestRequestBuilding {

def WS(uri: Uri, clientSideHandler: Flow[Message, Message, Any], materializer: Materializer): HttpRequest = {
def WS[T](uri: Uri, clientSideHandler: Flow[Message, Message, T], materializer: Materializer): HttpRequest = {
WS(uri, clientSideHandler, materializer, java.util.Collections.emptyList())
}

def WS(
def WS[T](
uri: Uri,
clientSideHandler: Flow[Message, Message, Any],
clientSideHandler: Flow[Message, Message, T],
materializer: Materializer,
subprotocols: java.util.List[String]): HttpRequest = {

Expand Down

0 comments on commit 6a8eb6b

Please sign in to comment.