KeyValueAndUnitData.create() returns a package-private type
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
sdk/profiles/src/main/java/io/opentelemetry/sdk/profiles/data/KeyValueAndUnitData.java を開き、KeyValueAndUnitData.create(int, Value<?>, int) を調べます。別のパッケージからの再現を確認し、その後、factory が public な KeyValueAndUnitData 型を公開するようにします。他の 10 個の *Data.create() factory と同様に、getter の呼び出しを直接コンパイルできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 2.5k
- フォーク
- 1k
- 平均マージ
- 2日 21時間
- マージ済み PR(30日)
- 74
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-java のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
open-telemetry/opentelemetry-java#8898 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-java#8896 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
open-telemetry/opentelemetry-java#8886 ·
メンテナーはふだん 2 日以内に返信
-
ComposableProbabilitySampler description still uses the old ComposableTraceIdRatioBasedSampler nameオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
open-telemetry/opentelemetry-java#8885 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
open-telemetry/opentelemetry-java#8884 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
beehive-lab/TornadoVM#1151 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
FasterXML/jackson-dataformats-binary#823 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信