Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor mono wrap method #3982

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Aleexender
Copy link
Contributor

@Aleexender Aleexender commented Feb 6, 2025

Description:
This refactoring improves the maintainability and readability of the Mono.wrap method through the following changes:

  1. Extract Mono source creation logic into a separate method (createMonoSource)

    • Reduces cognitive complexity of the main wrap method
    • Makes the source creation logic more focused and easier to maintain
  2. Simplify conditional logic using ternary operators

    • Reduces nesting levels in the code
    • Makes the flow control more straightforward
  3. Improve type handling consistency

    • Refined type casting structure following existing patterns
    • Maintained consistent use of SuppressWarnings annotations in line with the codebase's existing conventions

The changes maintain the exact same functionality while making the code structure clearer and more maintainable.

@Aleexender Aleexender requested a review from a team as a code owner February 6, 2025 13:31
@Aleexender Aleexender force-pushed the refactor-mono-wrap-method branch from 0994bb4 to ac9dd7f Compare February 6, 2025 13:33
@Aleexender Aleexender force-pushed the refactor-mono-wrap-method branch from ac9dd7f to ca27366 Compare February 6, 2025 13:34
@Aleexender
Copy link
Contributor Author

@chemicL hello!
I'm curious about why the testLeakWithRetryWhenImmediatelyCancelled() test in the core-java21 CI pipeline is failing.
While it runs perfectly fine in my local environment, I'm wondering if my changes could have inadvertently caused this issue.

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