KeyValueAndUnitData.create() returns a package-private type
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 91/100
Research direction
Open sdk/profiles/src/main/java/io/opentelemetry/sdk/profiles/data/KeyValueAndUnitData.java and inspect KeyValueAndUnitData.create(int, Value<?>, int). Confirm the reproduction from another package, then make the factory expose the public KeyValueAndUnitData type. Done means the getter call compiles directly, matching the other ten *Data.create() factories.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 2.5k
- Forks
- 1k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 63
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-telemetry/opentelemetry-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-telemetry/opentelemetry-java#8869 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-telemetry/opentelemetry-java#8867 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
open-telemetry/opentelemetry-java#8866 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-telemetry/opentelemetry-java#8843 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-telemetry/opentelemetry-java#8688 ·
Maintainers usually reply within 1 day
All issues in open-telemetry/opentelemetry-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
refinedmods/refinedstorage2#1414 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
In Java's `LongBoundedSum`, setting `lower` to `Long.MIN_VALUE` under-estimates the sensitivityOpen
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
google/differential-privacy#489 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
link-check link-check:manual
Difficulty 2/5 1-3 hours Newbie friendliness 85/100