Add wildcard bounds to Java DSL parameters that are needlessly invariant
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
調査の方向性
Read the Java DSL signatures for Source, Sink, Flow, SubFlow, SubSource, and FlowWithContext, plus persistence-typed javadsl Effect.persist(events). Start with the Java tests that exercise these parameters and add narrower-typed variables to verify they compile. Done means the listed wildcard bounds are consistent, those tests pass, and mimaReportBinaryIssues stays clean for stream and persistence-typed.
索引モデルが issue の本文から書いたものです。
説明
Java generics are invariant, so several Java DSL parameters reject values that a Java user would reasonably expect to pass, typically a variable whose declared type is a narrower generic (e.g. List<Source<T, NotUsed>> or List<ItemAdded>). Lambdas mostly adapt to the target type; pre-typed variables, fields and method references do not.
Adding wildcard bounds only changes the generic signature, not the erased descriptor, so this should be binary compatible (MiMa clean) and source compatible for existing Java and Scala callers.
Parameters that reject ordinary Java variables
| Location | Today | Suggested |
|---|---|---|
javadsl.Source.combine rest |
java.util.List[Source[T, ? <: Any]] |
java.util.List[? <: Graph[SourceShape[T], ?]] |
javadsl.Source.zipN, zipWithN |
java.util.List[Source[T, ? <: Any]] |
java.util.List[? <: Graph[SourceShape[T], ?]] |
javadsl.Source.mergePrioritizedN |
java.util.List[Pair[Source[T, ? <: Any], Integer]] |
java.util.List[? <: Pair[? <: Graph[SourceShape[T], ?], Integer]] |
javadsl.Sink.combine rest |
java.util.List[Sink[U, ?]] |
java.util.List[? <: Graph[SinkShape[U], ?]] |
persistence-typed javadsl.Effect.persist(events) |
java.util.List[Event] |
java.util.List[? <: Event] |
For example, List<Source<Integer, NotUsed>> sources = ...; Source.zipN(sources) does not compile today, and neither does passing a List<ItemAdded> to Effect().persist(...) when the behavior's event type is Event. The newer list-based Source.combine / Sink.combine overloads and mergeAll already use java.util.List[? <: Graph[...]], and the scaladsl persist takes a covariant immutable.Seq[Event].
Inconsistencies with sibling operators
The same operator has a bound in one class but not in its siblings:
mapConcat:Source,SourceWithContextandFlowWithContextuseFunction[Out, ? <: java.lang.Iterable[T]];Flow,SubFlowandSubSourcetake a plainjava.lang.Iterable[T].statefulMapConcat: the inner function returns a plainjava.lang.Iterable[T]inSource,Flow,SubFlowandSubSource; should be? <: java.lang.Iterable[T].recoverWith/recoverWithRetries:SourceandFlowrecoverWith(pf)use? <: Graph[SourceShape[Out], NotUsed];SubFlow,SubSourceandFlow.recoverWithRetriesdo not.fanInStrategy/fanOutStrategy:Source.combine(first, second, rest, ...)usesFunction[Integer, ? <: Graph[...]]; the list-basedSource.combineoverload andSink.combine/Sink.combineMatdo not.
Tests
Java tests should pass a variable of the narrower type (which fails to compile before the change), and mimaReportBinaryIssues for stream and persistence-typed should stay clean.
- 主要言語
- Scala
- スター
- 1.7k
- フォーク
- 212
- 平均マージ
- 18時間 4分
- マージ済み PR(30日)
- 113
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/pekko のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/pekko#1840 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
Coordinator singleton lease loss permanently stops the local ShardRegion while the node is still Up対応中かも @He-Pin が 5 日前に担当しました。 オープンbug cluster
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
enhancement flaky make-tests-easier-to-run
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
build enhancement github_actions
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
lichess-org/lila#22324 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Users who join a new meeting at the same moment: one sometimes gets "Ops, something went wrong" because bbb-web drops their registration (race on `Meeting.userCustomData`)対応中かも @antobinary が今日担当しました。 オープンmodule: core
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bigbluebutton/bigbluebutton#26318 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:ci enhancement priority:low requires-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
apache/datafusion-comet#7319 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
canton-network/splice#8087 ·
メンテナーはふだん 1 日以内に返信