JSON map and URL parameter builders fail for types with a version parameter
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Start in core/src/main/java/com/backblaze/b2/json/B2JsonObjectHandler.java. Compare the array allocation at line 457 in the normal deserialize path, which uses constructorParamCount and fills the version parameter around lines 492-494, with the two allocations at lines 504 and 536 in deserializeFromFieldNameToValueMap and deserializeFromUrlParameterMap. Done when a test class annotated with versionParam can be built through both methods without an IllegalArgumentException, and the version value is set there too.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
For a type that declares a versionParam, the normal deserialize path sizes its constructor argument array with constructorParamCount (fields plus the version parameter). deserializeFromFieldNameToValueMap and deserializeFromUrlParameterMap size it with fields.length, so the array is one element short and constructor.newInstance throws an unchecked IllegalArgumentException (wrong number of arguments) that is not turned into a B2JsonException.
Where
core/src/main/java/com/backblaze/b2/json/B2JsonObjectHandler.java:504 and :536 (compare :457, and :235-236 where constructorParamCount is set); the version parameter is filled in at :492-494 only on the normal path.
Why it matters
Impact: Availability (building the object fails), loud. Severity: High, because it only affects types that use versionParam and are built from a map or URL parameters (unusual), and no type in the SDK's main code uses versionParam.
How to check
Found by reading the code, not reproduced. Read the three array allocations. A test could define a @B2Json.type(versionParam = "v") class and call deserializeFromFieldNameToValueMap or deserializeFromUrlParameterMap on it. Using constructorParamCount and setting the version parameter in those two methods would fix it.
Version
Seen at v6.5.0. Present on the default branch: present.
- Ngôn ngữ chính
- Java
- Star
- 103
- Fork
- 23
- Merge trung bình
- 5 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 Backblaze/b2-sdk-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Backblaze/b2-sdk-java#248 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Backblaze/b2-sdk-java#247 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Backblaze/b2-sdk-java#246 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Backblaze/b2-sdk-java#245 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Backblaze/b2-sdk-java#242 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của Backblaze/b2-sdk-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
IETF-Hackathon/pqc-certificates#351 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted textCó thể đã có người làm @Bhumit267 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation typeCó thể đã có người làm @Carbon14-48 đã nhận hôm nay. Đang mởapproved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
checkstyle/checkstyle#22784 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày