Inconsistent null Handling Across JSONObject Construction Paths
まだ誰も着手していません。
評価
調査の方向性
Start by tracing the three construction paths shown in the reproduction: the String constructor, Map constructor, and put() call. Compare their current null behavior and add or update tests for each path; done means all retain a JSON null value consistently and the relevant test suite passes.
索引モデルが issue の本文から書いたものです。
説明
Jar version : json-20251224.jar
Reproduction :
// String constructor — null preserved
new JSONObject("{\"name\":null}"); // {"name":null}
// Map constructor — null dropped
Map<Object, Object> map = new HashMap<>();
map.put("name", null);
new JSONObject(map); // {}
// put() — null dropped
JSONObject json = new JSONObject();
json.put("name", (String) null); // {}
Expected :
All construction paths should treat null consistently. Per the JSON spec (RFC 8259), null is a valid value and should be retained.
- 主要言語
- Java
- スター
- 4.7k
- フォーク
- 2.6k
- 平均マージ
- 6日 20時間
- マージ済み PR(30日)
- 2
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stleary/JSON-java のほかの issue
-
Fix before the next release
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
Fix before the next release
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
stleary/JSON-java の issue をすべて見る
似ている issue
-
link-check link-check:manual
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
open-telemetry/opentelemetry-java#8870 ·
メンテナーはふだん 1 日以内に返信
-
P2 testing
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
enhancement javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area/core kind/bug status/triage team/core-shared
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信