Removing boxed types for nregion property check#48656
Merged
mbhaskar merged 2 commits intoAzure:mainfrom Apr 1, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes nullable boxed Boolean usage for the “N region synchronous commit enabled” flag in Cosmos DB internal request/account state, standardizing missing/unknown values to false to avoid null propagation.
Changes:
- Changed
GlobalEndpointManager#getNRegionSynchronousCommitEnabledto return primitivebooleanand default tofalsewhenlatestDatabaseAccountis unset. - Changed
DocumentServiceRequestContext#setNRegionSynchronousCommitEnabledto accept primitiveboolean. - Changed
DatabaseAccount#isNRegionSynchronousCommitEnabledto return primitivebooleanand default tofalsewhen the property is absent.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java | Eliminates nullable return for n-region sync commit flag; defaults missing account state to false. |
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DocumentServiceRequestContext.java | Removes boxed type in setter to prevent null/unboxing issues and standardize boolean flow. |
| sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DatabaseAccount.java | Removes nullable return for account capability check; defaults absent property to false. |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DatabaseAccount.java
Show resolved
Hide resolved
...cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/GlobalEndpointManager.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/DatabaseAccount.java
Show resolved
Hide resolved
jeet1995
approved these changes
Mar 31, 2026
Member
|
CHANGELOG? |
Member
Author
|
/azp run java - cosmos |
|
Azure Pipelines successfully started running 1 pipeline(s). |
xinlian12
reviewed
Apr 1, 2026
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.
Description
Removing boxedtypes while checking for nregion property on database account. This was earlier defaulted to false anyway, so null is now considered as false.
Fixes: #48630
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines