SPDX IDs that differ only by case are treated as duplicates
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 58/100
調査の方向性
Start with src/main/java/org/spdx/storage/simple/InMemSpdxStore.java and trace how exists, create, getItem, delete, and getCaseSensitiveId form and look up map keys. Check the tests for InMemSpdxStore and add coverage for two SPDX IDs that differ only by case. Done means both IDs can be stored and resolved independently without a duplicate exception.
索引モデルが issue の本文から書いたものです。
説明
Summary
InMemSpdxStore stores each element under a lowercased object URI. Two SPDX IDs that differ only by letter case therefore collide, and create throws DuplicateSpdxIdException.
SPDX 2.3.1 treats those IDs as different. An SPDXID is SPDXRef- plus a unique idstring of letters, numbers, ., and -. The specification does not fold case. SPDXRef-Arcturus.ogg and SPDXRef-arcturus.ogg are two identifiers.
The element URI is [document namespace]#[SPDX identifier]. URI fragments are case-sensitive, so those two IDs are also different element URIs.
The 2.3.1 JSON schema allows both cases in one pattern: ^SPDXRef-[a-zA-Z0-9.-]+$.
Spec
- File SPDX identifier (2.3.1, clause 8.2): https://spdx.github.io/spdx-spec/v2.3.1/file-information/#82-file-spdx-identifier-field
- Package SPDX identifier (2.3.1, clause 7.2): https://spdx.github.io/spdx-spec/v2.3.1/package-information/#72-package-spdx-identifier-field
- Element URI form,
[document namespace]#[SPDX identifier]: same clauses, RDF examples - JSON schema
SPDXIDpattern: https://github.com/spdx/spdx-spec/blob/v2.3.1/schemas/spdx-schema.json
Actual behavior
InMemSpdxStore in v2.0.5 uses the lowercased URI as the map key:
exists:typedValueMap.containsKey(objectUri.toLowerCase())create:typedValueMap.putIfAbsent(typedValue.getObjectUri().toLowerCase(), value), thenDuplicateSpdxIdExceptionwhen the key is already presentgetItem,delete, andgetCaseSensitiveIdalso look uptoLowerCase()
v1.1.10 does the same with id.toLowerCase(). Loading a document that contains both IDs fails there with:
org.spdx.library.model.DuplicateSpdxIdException: ID SPDXRef-system-product-media-audio-notifications-arcturus.ogg already exists.
That document has two different files:
SPDXRef-system-product-media-audio-notifications-Arcturus.oggfor/system/product/media/audio/notifications/Arcturus.oggSPDXRef-system-product-media-audio-notifications-arcturus.oggfor/system/product/media/audio/notifications/arcturus.ogg
Expected behavior
IDs that differ only by case are stored and resolved as different elements.
Code
- 主要言語
- Java
- スター
- 72
- フォーク
- 45
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
spdx/Spdx-Java-Library のほかの issue
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
spdx/Spdx-Java-Library#449 ·
メンテナーはふだん 1 日以内に返信
-
question
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
spdx/Spdx-Java-Library#398 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
wontfix
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
spdx/Spdx-Java-Library#393 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
matching
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
spdx/Spdx-Java-Library#392 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
spdx/Spdx-Java-Library#390 · コメント 11 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
spdx/Spdx-Java-Library の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
CI: LFC/ANTLR caches still use the old lfc/ paths, so the ANTLR jar is downloaded on every run対応中かも @NicoBiernat が今日担当しました。 オープンbug CI
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
lf-lang/reactor-uc#443 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Card-Forge/forge#13128 ·
メンテナーはふだん 1 日以内に返信
-
client documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
ClickHouse/clickhouse-java#3469 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信