Collection Membership operator can return unintuitive results if collection has mix of types
まだ誰も着手していません。
評価
調査の方向性
CollectionMembershipOperator.java、特に34-47行目から始め、membership 操作と “is containing” 操作が混在型のコレクションをどのように型変換するかを追跡してください。issue の例を再現し、その後、想定される比較動作を確立してから、null、数値、文字列、ブール値が一貫して処理されることを示すために必要なリグレッションテストのカバレッジを特定してください。
索引モデルが issue の本文から書いたものです。
説明
Since the CollectionMembershipOperator coerces the type of the item being tested to the first (or first non-null) element in the list, it can lead to unexpected/unintuitive results.
{{ null in [null, 1, 2] }} {# true #}
{{ null in [1, null, 2] }} {# false - null converted to 0; no 0 in list #}
{{ null in [1, null, 2, 0] }} {# true - because of the 0 in the list, not the null #}
{{ null in [0, 1, 2] }} {# true #}
{{ 1 in ['1', 2 ] }} {# true - 1 converted to '1' #}
{{ 2 in ['1', 2 ] }} {# false - 2 is converted to '2', no '2' in list #}
{{ 1 in [false, 1] }} {# false - 1 converted to true #}
{{ 1 in [true, 0] }} {# true #}
{{ 1 in [null, 'abc', 1] }} {# false #}
{{ '' in [1, '', 2] }} {# false #}
{{ '' in [0, 1, 2] }} {# true #}
(The same applies to is containing, e.g. [false, 1] is containing 1 is false)
- 主要言語
- Java
- スター
- 787
- フォーク
- 184
- 平均マージ
- 6日 22時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HubSpot/jinjava のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
Upgrade jsoupオープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 82/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
HubSpot/jinjava の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
commonmark/commonmark-java#460 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
1.21.1见幽匿感测体就崩溃オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Make branch and label autocomplete matching locale-independent対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
jenkinsci/gitlab-plugin#1950 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
commons-app/apps-android-commons#6984 ·
メンテナーはふだん 2 日以内に返信