Skip to content

Conversation

@sobychacko
Copy link
Contributor

Replace nested null checks and redundant branching with streamlined Optional-based approach. Since getResult() == getResults().get(0), processing all results handles both single and multiple result cases.

Fixes #4292

The original code had an unreachable else condition. This PR attempts to fix this unreachability. Once this PR is merged, we can close this one: #4292

Replace nested null checks and redundant branching with streamlined
Optional-based approach. Since getResult() == getResults().get(0),
processing all results handles both single and multiple result cases.

Adding tests to verify.

Fixes spring-projects#4292

Signed-off-by: Soby Chacko <[email protected]>
@ilayaperumalg
Copy link
Member

@sobychacko Thanks for refactoring! LGTM. Rebased and merged as 356fced. Cherry-picked into 1.0.x as 4a4808d. Also, made sure to update the commit to include "Co-Authored-By: eeaters [email protected]" to give credit to the author who submitted the original PR proposing the changes.

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.

2 participants