Skip to content

Conversation

silvio2402
Copy link
Contributor

  • Refactor the logic to extract the phone context from an RFC3966 URI to a new PhoneContextParser class.
  • Refactor the number normalization methods normalizeDigits and normalizeDigitsOnly to a new PhoneNumberNormalizer class.

    This keeps PhoneNumberUtil.normalizeDigitsOnly as a shell because it is public.

  • Move the constants that are common between PhoneContextParser and PhoneNumberUtil to a new Constants class.

This is a refactor and should not change the logic of the parser.

Context: b/370922064

PhoneNumberNormalizer.normalizeDigitsOnly(phoneContext.substring(1));

// Check if the phone context is a valid country calling code.
if (!normalizedPhoneContext.equals("")
Copy link
Member

Choose a reason for hiding this comment

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

How about introducing Constants.MIN_LENGTH_COUNTRY_CODE

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