Fix ReferenceBean type mismatch and add regression test#15889
Closed
ishankhemani wants to merge 1 commit intoapache:3.3from
Closed
Fix ReferenceBean type mismatch and add regression test#15889ishankhemani wants to merge 1 commit intoapache:3.3from
ishankhemani wants to merge 1 commit intoapache:3.3from
Conversation
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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