Replace `BiMap` with plain maps
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start by tracing how SchemaClassScanner builds TypeClassDictionary and how SchemaParser uses it in both directions, including resolver return types. Then review SchemaParserDictionary.getDictionary() and the graphql-spring-boot call to builder.dictionary(); done means duplicate classes produce a SchemaClassScannerError naming the class and types, the new map-returning method is used without breaking the old API, and BiMap can be removed in a later major release.
索引モデルが issue の本文から書いたものです。
説明
graphql.kickstart.tools.util.BiMap is a copy of Guava's BiMap we added when we dropped Guava (661769e). Neither Java nor Kotlin has a bidirectional map, so it stuck around. After #851 it doesn't really pull its weight anymore.
Where it's used:
SchemaClassScannerbuilds aBiMap<TypeDefinition, JavaType>(TypeClassDictionary).SchemaParserreads it both ways:dictionary[definition]for enum classes anddictionary.inverse()forInterfaceTypeResolverandUnionTypeResolver.BiMap#putthrowingvalue already presentis the only thing that enforces one class per output type. It shows up asError creating bimap of type => class, which isn't a very helpful message. It also catches classes found through resolver return types, not just dictionary entries, so a replacement needs an explicit check.SchemaParserDictionarystores a plain map since #851.getDictionary()still returns aBiMapfor backwards compatibility (graphql-spring-boot callsbuilder.dictionary(dictionary.getDictionary())), but itsinverse()only keeps the first name when several input types share a class.
Proposal:
- Internally, use two plain maps plus an explicit duplicate check that throws a
SchemaClassScannerErrornaming the class and the types. No API change.
typeToClass.entries.groupBy({ it.value }, { it.key })
.filterValues { it.size > 1 }
.forEach { (clazz, types) -> throw SchemaClassScannerError("...") }
val classToType = typeToClass.entries.associate { (type, clazz) -> clazz to type }
- Add a replacement for
getDictionary()that returnsMap<String, Class<*>>under a new name, and deprecategetDictionary(). Changing the return type in place would break binary compatibility. - Switch graphql-spring-boot to the new method.
- Remove
BiMapin the next major.
- 主要言語
- Kotlin
- スター
- 824
- フォーク
- 175
- 平均マージ
- 2日 5時間
- マージ済み PR(30日)
- 52
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphql-java-kickstart/graphql-java-tools のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
graphql-java-kickstart/graphql-java-tools#893 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
graphql-java-kickstart/graphql-java-tools#889 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
graphql-java-kickstart/graphql-java-tools#886 ·
メンテナーはふだん 1 日以内に返信
-
Reject directives applied at the wrong location, without a required argument or twice in 15.0.0オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
graphql-java-kickstart/graphql-java-tools#884 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
graphql-java-kickstart/graphql-java-tools#881 ·
メンテナーはふだん 1 日以内に返信
graphql-java-kickstart/graphql-java-tools の issue をすべて見る
似ている issue
-
LiquidGlass / LiquidGlassContainer (iOS): padded content measured at the outer width and overflows by the padding対応中かも @aleclarson が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NativeScript/NativeScript#11561 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
navikt/mock-oauth2-server#1129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
thunderbird/thunderbird-android#11778 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
software-mansion/enriched-markdown#1042 ·
メンテナーはふだん 2 日以内に返信