SPDX IDs that differ only by case are treated as duplicates
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 72
- Fork
- 45
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spdx/Spdx-Java-Library
-
question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
spdx/Spdx-Java-Library#449 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
spdx/Spdx-Java-Library#398 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
wontfix
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
spdx/Spdx-Java-Library#393 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
matching
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
spdx/Spdx-Java-Library#392 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
spdx/Spdx-Java-Library#390 · 11 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spdx/Spdx-Java-Library
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
CI: LFC/ANTLR caches still use the old lfc/ paths, so the ANTLR jar is downloaded on every runCó thể đã có người làm @NicoBiernat đã nhận hôm nay. Đang mởbug CI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
lf-lang/reactor-uc#443 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Card-Forge/forge#13128 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
client documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
ClickHouse/clickhouse-java#3469 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày