Skip to content

fix: port behavior fixes from upstream Java libphonenumber#322

Merged
twcclegg merged 1 commit intomainfrom
claudeFixesFromPort
May 4, 2026
Merged

fix: port behavior fixes from upstream Java libphonenumber#322
twcclegg merged 1 commit intomainfrom
claudeFixesFromPort

Conversation

@twcclegg
Copy link
Copy Markdown
Owner

@twcclegg twcclegg commented May 3, 2026

  • FormatNumberForMobileDialing: add parens around (MX || CL || UZ) so isFixedLineOrMobile applies to all three regions; previously C# operator precedence caused MX/CL to skip the constraint.
  • FormatOutOfCountryKeepingAlphaChars: strip any extension already present in the raw input before appending the formatted extension, preventing duplicate extensions in the output (Java #3724).
  • FormatInOriginalFormat: call ChooseFormattingPatternForNumber once and reuse the result instead of recomputing it (Java #3976).
  • Drop redundant double-assignment in the BR carrier-code branch.

Changes

- FormatNumberForMobileDialing: add parens around (MX || CL || UZ) so
  isFixedLineOrMobile applies to all three regions; previously C#
  operator precedence caused MX/CL to skip the constraint.
- FormatOutOfCountryKeepingAlphaChars: strip any extension already
  present in the raw input before appending the formatted extension,
  preventing duplicate extensions in the output (Java #3724).
- FormatInOriginalFormat: call ChooseFormattingPatternForNumber once
  and reuse the result instead of recomputing it (Java #3976).
- Drop redundant double-assignment in the BR carrier-code branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@twcclegg twcclegg requested a review from wmundev May 3, 2026 20:48
@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.23%. Comparing base (cadd7f2) to head (f5e2c9d).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
csharp/PhoneNumbers/PhoneNumberUtil.cs 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #322      +/-   ##
==========================================
- Coverage   75.27%   75.23%   -0.04%     
==========================================
  Files          34       34              
  Lines        4424     4417       -7     
  Branches     1001     1001              
==========================================
- Hits         3330     3323       -7     
  Misses        885      885              
  Partials      209      209              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@wmundev wmundev left a comment

Choose a reason for hiding this comment

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

LGTM

@twcclegg twcclegg merged commit 040fadb into main May 4, 2026
6 checks passed
@twcclegg twcclegg deleted the claudeFixesFromPort branch May 4, 2026 02:39
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.

2 participants