KeyValueAndUnitData.create() returns a package-private type
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 91/100
Hướng nghiên cứu
Mở sdk/profiles/src/main/java/io/opentelemetry/sdk/profiles/data/KeyValueAndUnitData.java và kiểm tra KeyValueAndUnitData.create(int, Value<?>, int). Xác nhận việc tái hiện từ một package khác, sau đó làm cho factory expose kiểu public KeyValueAndUnitData. Hoàn tất khi lệnh gọi getter biên dịch trực tiếp, tương tự như mười factory *Data.create() còn lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
KeyValueAndUnitData.create(int, Value<?>, int) declares the package-private ImmutableKeyValueAndUnitData as its return type. Code outside io.opentelemetry.sdk.profiles.data cannot call a getter directly on the result.
Steps to reproduce
From any other package, compile:
KeyValueAndUnitData.create(1, Value.of("v"), 2).getKeyStringIndex();
What did you expect to see?
It compiles. The method's Javadoc says it returns a KeyValueAndUnitData, and the other ten *Data.create() factories in the package return their public interface type.
What did you see instead?
error: KeyValueAndUnitData.getKeyStringIndex() is defined in an inaccessible class or interface
Declared at KeyValueAndUnitData.create() (sdk/profiles/src/main/java/io/opentelemetry/sdk/profiles/data/KeyValueAndUnitData.java line 21). Assigning the result to a KeyValueAndUnitData variable first works, which is why in-repo callers compile.
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-profiles (alpha)
Version: main @ ce32c1205
How did you reference these artifacts? N/A (repo build)
Environment
Compiler: Temurin 21 (--release 8)
OS: N/A
Additional context
Fix: change the declared return type to KeyValueAndUnitData.
- Ngôn ngữ chính
- Java
- Star
- 2.5k
- Fork
- 1k
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 63
Chuẩn bị môi trường
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 open-telemetry/opentelemetry-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-telemetry/opentelemetry-java#8869 ·
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 88/100
open-telemetry/opentelemetry-java#8867 ·
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 84/100
open-telemetry/opentelemetry-java#8866 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
open-telemetry/opentelemetry-java#8843 ·
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 76/100
open-telemetry/opentelemetry-java#8688 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của open-telemetry/opentelemetry-java
Issue tương tự
-
ScyllaDB Manual: 3 broken linksĐang mởlink-check link-check:manual
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
P2 testing
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement javascript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/core kind/bug status/triage team/core-shared
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ai-suggestions documentation good first issue P3
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
uttrflow/uttrflow-swift#2093 ·
Maintainer thường phản hồi trong vòng 1 ngày