pjfanning commented on issue #3712: URL: https://github.com/apache/pekko/issues/3712#issuecomment-6421792710
Lower-priority candidates found in the same review that are **not** covered by the PR for this issue. These only help when a caller wants a wider type than the argument has (e.g. `Source<Number, NotUsed> s = Source.from(listOfIntegers)`) or passes a pre-typed function value; lambdas already adapt to the target type. - `javadsl.Source.from(java.lang.Iterable[O])` → `java.lang.Iterable[? <: O]`. The scaladsl equivalent takes a covariant `immutable.Iterable`. The `case c: java.util.Collection[O]` matches in the body would need adjusting. - `javadsl.Source.fromOption(Optional[T])` → `Optional[? <: T]`. - `javadsl.Source.completionStage(CompletionStage[T])` → `CompletionStage[? <: T]`. - `javadsl.Sink.actorRef(..., onFailureMessage: Function[Throwable, Any])` → `Function[? >: Throwable, ?]`, matching the existing `Predicate[? >: Throwable]` convention. Also noticed while implementing, same category: - `recoverWith(clazz, creator)` / `recoverWithRetries(attempts, clazz, creator)` on `Source` / `Flow` take `Creator[Graph[SourceShape[Out], NotUsed]]`; could be `Creator[? <: Graph[...]]` to accept a pre-typed `Creator<Source<Out, NotUsed>>`. - `Source.fromMaterializer`, `Flow.fromMaterializer` and `Sink.fromMaterializer` factories return a concrete `Source` / `Flow` / `Sink`; could be `? <: Graph[...]`. - `Source.completionStageSource`, `Flow.completionStageFlow`, `Sink.completionStageSink` / `eagerCompletionStageSink` take `CompletionStage[Source[T, M]]` etc.; could be `CompletionStage[? <: Graph[...]]`. Reviewed and judged not worth changing: the `Supplier[...]` parameters in testkit and the persistence command handlers, `Optional[...]` settings parameters, `Map[String, String]` MDC parameters, `ExternalShardAllocationClient.setShardLocations` (final key/value types), and `ActorContext.pipeToSelf` (type parameter is inferred from the argument). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
