Skip to content

fix: remove unread objectSerializer field and run SpotBugs after compile - #1930

Open
cicoyle wants to merge 3 commits into
dapr:masterfrom
cicoyle:fix-spotbugs-unread-object-serializer
Open

cicoyle wants to merge 3 commits into
dapr:masterfrom
cicoyle:fix-spotbugs-unread-object-serializer

Conversation

@cicoyle

@cicoyle cicoyle commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

#1918 moved the reads of objectSerializer out of DaprClientImpl into DaprServiceInvocationClient, leaving the field in AbstractDaprClient assigned but never read. SpotBugs flags it as URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD, which has failed every scheduled Java SDK verification run in dapr/dapr since, for example https://github.com/dapr/dapr/actions/runs/47324019338.

  1. Remove the unread field and its constructor parameter. DaprClientImpl keeps its own objectSerializer and passes it to the helper clients it builds, so behavior is unchanged. AbstractDaprClient is package-private, so this is not a public API change.
  2. Run the SpotBugs check after compile. It was bound to the validate phase, which runs before compile. Every CI command here runs clean first, so SpotBugs analyzed an empty target/classes and always passed. That is why refactor: move service invocation out of DaprClientImpl #1918 merged green here and only failed downstream in dapr/dapr. The check now runs in process-classes, so it runs in every build that compiles. Checkstyle is unchanged and still runs in validate.

Running SpotBugs on compiled classes surfaced 8 findings in MethodInvokeServiceProtos, the protobuf code generated in sdk-tests. That generated code and its gRPC stub are excluded in spotbugs-exclude.xml, as the generated code in sdk-autogen, sdk-workflows and examples already is.

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
@cicoyle
cicoyle requested review from a team as code owners December 4, 2026 17:46
Copilot AI balanced review requested due to automatic review settings December 4, 2026 17:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

Review effort: Balanced

javier-aliaga
javier-aliaga previously approved these changes Dec 4, 2026
Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Copilot AI balanced review requested due to automatic review settings December 4, 2026 20:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.95%. Comparing base (c47d51b) to head (6a370ce).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1930      +/-   ##
============================================
- Coverage     82.97%   82.95%   -0.03%     
+ Complexity     3985     3984       -1     
============================================
  Files           361      361              
  Lines         11978    11977       -1     
  Branches       1339     1339              
============================================
- Hits           9939     9935       -4     
- Misses         1537     1542       +5     
+ Partials        502      500       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants