Skip to content

Conversation

@julianlen
Copy link
Contributor

Description

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

@julianlen julianlen requested a review from a team as a code owner December 19, 2025 15:29
@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@julianlen julianlen requested a review from Copilot December 19, 2025 15:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the getRetiringFederationThreshold method to return an Optional<Integer> instead of a primitive int, improving the API design by making the absence of a retiring federation explicit rather than using a magic value (-1).

Key changes:

  • Modified the return type from int to Optional<Integer> across the federation support interface and implementations
  • Updated all test cases to assert on Optional presence/absence instead of checking for magic values
  • Added explicit handling in the Bridge class to maintain backward compatibility by converting empty Optional to the error code

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
FederationSupport.java Updated interface signature and documentation to return Optional
FederationSupportImpl.java Simplified implementation to return Optional directly instead of using orElseGet with error code
BridgeSupport.java Updated method signature to pass through Optional
Bridge.java Added conversion from Optional to error code for backward compatibility
FederationSupportImplTest.java Updated test assertions to check Optional.isEmpty() instead of comparing to magic value
BridgeSupportTest.java Updated mock setup and assertions to work with Optional
BridgeSupportIT.java Updated integration test assertions to check Optional presence and unwrap values
BridgeIT.java Updated mock setup to return Optional.of(value)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@jeremy-then jeremy-then left a comment

Choose a reason for hiding this comment

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

LGTM.

@sonarqubecloud
Copy link

@marcos-iov marcos-iov merged commit 880dde3 into mtmu-integration Dec 19, 2025
9 checks passed
@marcos-iov marcos-iov deleted the getRetiringFederationThrehsold-optional branch December 19, 2025 19:24
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.

4 participants