Skip to content

fix: scope generated protobuf classes under SDK namespace to avoid FQCN conflicts#2737

Open
imshubham22apr-gif wants to merge 1 commit into
hiero-ledger:mainfrom
imshubham22apr-gif:fix/protobuf-package-scope
Open

fix: scope generated protobuf classes under SDK namespace to avoid FQCN conflicts#2737
imshubham22apr-gif wants to merge 1 commit into
hiero-ledger:mainfrom
imshubham22apr-gif:fix/protobuf-package-scope

Conversation

@imshubham22apr-gif

Copy link
Copy Markdown
Contributor

What does this PR do?

Scopes generated protobuf classes under an SDK-specific namespace to avoid FQCN conflicts when the SDK is used alongside hedera-protobuf-java-api.

Why is this needed?

Some protobuf files define their own java_package (e.g. com.hedera.hapi.*), which can lead to classpath conflicts if both SDK and protobuf artifacts are present in a project.

What is included?

  1. Adds a build-level transformation step that remaps java_package values during generation
  2. Leaves upstream .proto files unchanged
  3. Ensures all generated classes are placed under com.hedera.hashgraph.sdk.proto.*

Notes :-

  1. No changes to protobuf source files
  2. Minimal, build-only change for safer maintenance
  3. Verified with ./gradlew :sdk:assemble

…nsformation

Signed-off-by: Aashish Pandit <imshubham.22apr@gmail.com>
@imshubham22apr-gif imshubham22apr-gif requested a review from a team as a code owner May 2, 2026 09:42
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 medium

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Complexity 1 medium

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant