Skip to content

Conversation

@ishankhemani
Copy link

@ishankhemani ishankhemani commented Dec 21, 2025

What does this PR do?

This PR fixes a Spring type resolution issue where ReferenceBean#getObjectType() could return an incompatible or undefined type, which may lead to BeanNotOfRequiredTypeException during dependency injection.

A regression test is added to ensure that a Spring application context can start successfully when @DubboReference is injected into a constructor-managed bean.

Why is this needed?

Spring relies on FactoryBean#getObjectType() during bean type prediction and dependency matching.
Returning an incorrect or unresolved type at this stage can cause bean creation failures during application context initialization.

How was this tested?

Added ReferenceBeanTypeInjectionTest

All existing tests pass

Additional notes

No UI changes

No screenshots required

Fixes #12637

Kindly review this PR when you get time.
Thank you for your guidance.
@AlbumenJ @RainYuY

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.74%. Comparing base (47a141c) to head (4ad0b07).

Files with missing lines Patch % Lines
.../org/apache/dubbo/config/spring/ReferenceBean.java 16.66% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15889      +/-   ##
============================================
- Coverage     60.75%   60.74%   -0.02%     
- Complexity    11703    11706       +3     
============================================
  Files          1938     1938              
  Lines         88694    88699       +5     
  Branches      13387    13388       +1     
============================================
- Hits          53886    53876      -10     
- Misses        29275    29290      +15     
  Partials       5533     5533              
Flag Coverage Δ
integration-tests-java21 32.31% <16.66%> (-0.02%) ⬇️
integration-tests-java8 32.40% <16.66%> (-0.14%) ⬇️
samples-tests-java21 31.98% <16.66%> (-0.12%) ⬇️
samples-tests-java8 29.60% <16.66%> (-0.02%) ⬇️
unit-tests-java11 59.03% <16.66%> (-0.02%) ⬇️
unit-tests-java17 58.53% <16.66%> (-0.02%) ⬇️
unit-tests-java21 58.53% <16.66%> (-0.02%) ⬇️
unit-tests-java25 58.50% <16.66%> (+<0.01%) ⬆️
unit-tests-java8 59.02% <16.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants