svn commit: r1846213 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1846213 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

jleroux@apache.org
Author: jleroux
Date: Fri Nov  9 08:01:49 2018
New Revision: 1846213

URL: http://svn.apache.org/viewvc?rev=1846213&view=rev
Log:
Improved: remove deprecated and not used PhoneNumber functions
(OFBIZ-10631)

Several phone number validation functions have been deprecated (and are not used in framework code).
This concerns:
    isUSPhoneNumber
    isUSPhoneAreaCode
    isUSPhoneMainNumber
    isInternationalPhoneNumber

Thanks: Pierre Smits

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java?rev=1846213&r1=1846212&r2=1846213&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilValidate.java Fri Nov  9 08:01:49 2018
@@ -671,61 +671,6 @@ public final class UtilValidate {
         return (isInteger(normalizedSSN) && normalizedSSN.length() == digitsInSocialSecurityNumber);
     }
 
-    /** isUSPhoneNumber returns true if string s is a valid U.S. Phone Number.  Must be 10 digits.
-     * @deprecated Use {@link #isValidPhoneNumber(String,Delegator)} instead
-     **/
-    @Deprecated
-    public static boolean isUSPhoneNumber(String s) {
-        if (isEmpty(s)) {
-            return defaultEmptyOK;
-        }
-        String normalizedPhone = stripCharsInBag(s, phoneNumberDelimiters);
-
-        return (isInteger(normalizedPhone) && normalizedPhone.length() == digitsInUSPhoneNumber);
-    }
-
-    /** isUSPhoneAreaCode returns true if string s is a valid U.S. Phone Area Code.  Must be 3 digits.
-     * @deprecated Use {@link #isValidPhoneNumber(String,Delegator)} instead
-     * */
-    @Deprecated
-    public static boolean isUSPhoneAreaCode(String s) {
-        if (isEmpty(s)) {
-            return defaultEmptyOK;
-        }
-        String normalizedPhone = stripCharsInBag(s, phoneNumberDelimiters);
-
-        return (isInteger(normalizedPhone) && normalizedPhone.length() == digitsInUSPhoneAreaCode);
-    }
-
-    /** isUSPhoneMainNumber returns true if string s is a valid U.S. Phone Main Number.  Must be 7 digits.
-     * @deprecated Use {@link #isValidPhoneNumber(String,Delegator)} instead
-     * */
-    @Deprecated
-    public static boolean isUSPhoneMainNumber(String s) {
-        if (isEmpty(s)) {
-            return defaultEmptyOK;
-        }
-        String normalizedPhone = stripCharsInBag(s, phoneNumberDelimiters);
-
-        return (isInteger(normalizedPhone) && normalizedPhone.length() == digitsInUSPhoneMainNumber);
-    }
-
-    /** isInternationalPhoneNumber returns true if string s is a valid
-     *  international phone number.  Must be digits only; any length OK.
-     *  May be prefixed by + character.
-     *  @deprecated Use {@link #isValidPhoneNumber(String,Delegator)} instead
-     */
-    @Deprecated
-    public static boolean isInternationalPhoneNumber(String s) {
-        if (isEmpty(s)) {
-            return defaultEmptyOK;
-        }
-
-        String normalizedPhone = stripCharsInBag(s, phoneNumberDelimiters);
-
-        return isPositiveInteger(normalizedPhone);
-    }
-
     /** isZIPCode returns true if string s is a valid U.S. ZIP code.  Must be 5 or 9 digits only. */
     public static boolean isZipCode(String s) {
         if (isEmpty(s)) {