From 14f65e569b2170e5a43b693ba53c89eb29963ce3 Mon Sep 17 00:00:00 2001 From: lararennie Date: Mon, 3 Apr 2017 10:45:43 +0200 Subject: [PATCH] Docs update (#1673) * Updating docs for getRegionCodeForNumber to clarify that it does not work for short codes or invalid numbers. --- cpp/src/phonenumbers/phonenumberutil.h | 3 ++- .../src/com/google/i18n/phonenumbers/PhoneNumberUtil.java | 3 ++- javascript/i18n/phonenumbers/phonenumberutil.js | 3 ++- pending_code_changes.txt | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cpp/src/phonenumbers/phonenumberutil.h b/cpp/src/phonenumbers/phonenumberutil.h index 7ad74d207..572ea8602 100644 --- a/cpp/src/phonenumbers/phonenumberutil.h +++ b/cpp/src/phonenumbers/phonenumberutil.h @@ -452,7 +452,8 @@ class PhoneNumberUtil : public Singleton { const string& region_code) const; // Returns the region where a phone number is from. This could be used for - // geo-coding at the region level. + // geocoding at the region level. Only guarantees correct results for valid, + // full numbers (not short-codes, or invalid numbers). void GetRegionCodeForNumber(const PhoneNumber& number, string* region_code) const; diff --git a/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java index 03a83c224..d521c8c68 100644 --- a/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +++ b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java @@ -2286,7 +2286,8 @@ public class PhoneNumberUtil { /** * Returns the region where a phone number is from. This could be used for geocoding at the region - * level. + * level. Only guarantees correct results for valid, full numbers (not short-codes, or invalid + * numbers). * * @param number the phone number whose origin we want to know * @return the region where the phone number is from, or null if no region matches this calling diff --git a/javascript/i18n/phonenumbers/phonenumberutil.js b/javascript/i18n/phonenumbers/phonenumberutil.js index 6e113f1f9..406b9c8db 100644 --- a/javascript/i18n/phonenumbers/phonenumberutil.js +++ b/javascript/i18n/phonenumbers/phonenumberutil.js @@ -3025,7 +3025,8 @@ i18n.phonenumbers.PhoneNumberUtil.prototype.isValidNumberForRegion = /** * Returns the region where a phone number is from. This could be used for - * geocoding at the region level. + * geocoding at the region level. Only guarantees correct results for valid, + * full numbers (not short-codes, or invalid numbers). * * @param {i18n.phonenumbers.PhoneNumber} number the phone number whose origin * we want to know. diff --git a/pending_code_changes.txt b/pending_code_changes.txt index 8b1378917..1d00d8ee4 100644 --- a/pending_code_changes.txt +++ b/pending_code_changes.txt @@ -1 +1,3 @@ - +Code changes: + - Doc updates for getRegionCodeForNumber to clarify that it does not + work for short-codes or invalid numbers.