You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bs...@apache.org on 2007/10/28 07:12:08 UTC

svn commit: r589274 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java

Author: bspeakmon
Date: Sat Oct 27 23:12:06 2007
New Revision: 589274

URL: http://svn.apache.org/viewvc?rev=589274&view=rev
Log:
- reformat/reindent pass; no functional change

Modified:
    commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java

Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java?rev=589274&r1=589273&r2=589274&view=diff
==============================================================================
--- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java (original)
+++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/EmailValidator.java Sat Oct 27 23:12:06 2007
@@ -64,6 +64,7 @@
 
     /**
      * Returns the Singleton instance of this validator.
+     *
      * @return singleton instance of this validator.
      */
     public static EmailValidator getInstance() {
@@ -81,7 +82,7 @@
      * <p>Checks if a field has a valid e-mail address.</p>
      *
      * @param email The value validation is being performed on.  A <code>null</code>
-     * value is considered invalid.
+     *              value is considered invalid.
      * @return true if the email address is valid.
      */
     public boolean isValid(String email) {
@@ -95,8 +96,6 @@
             return false;
         }
 
-
-        
         // Check the whole email address structure
         Pattern emailPattern = Pattern.compile(EMAIL_PATTERN);
         Matcher emailMatcher = emailPattern.matcher(email);
@@ -121,6 +120,7 @@
 
     /**
      * Returns true if the domain component of an email address is valid.
+     *
      * @param domain being validated.
      * @return true if the email address's domain is valid.
      */
@@ -155,6 +155,7 @@
 
     /**
      * Returns true if the user component of an email address is valid.
+     *
      * @param user being validated
      * @return true if the user name is valid.
      */
@@ -164,6 +165,7 @@
 
     /**
      * Validates a symbolic domain name.  Returns true if it's valid.
+     *
      * @param domain symbolic domain name
      * @return true if the symbolic domain name is valid.
      */
@@ -205,26 +207,28 @@
 
         return true;
     }
+
     /**
-     *   Recursively remove comments, and replace with a single space.  The simpler
-     *   regexps in the Email Addressing FAQ are imperfect - they will miss escaped
-     *   chars in atoms, for example.
-     *   Derived From    Mail::RFC822::Address
+     * Recursively remove comments, and replace with a single space.  The simpler
+     * regexps in the Email Addressing FAQ are imperfect - they will miss escaped
+     * chars in atoms, for example.
+     * Derived From    Mail::RFC822::Address
+     *
      * @param emailStr The email address
      * @return address with comments removed.
-    */
-    protected String stripComments(String emailStr)  {
-     String input = emailStr;
-     String result = emailStr;
-     String commentPat = "s/^((?:[^\"\\\\]|\\\\.)*(?:\"(?:[^\"\\\\]|\\\\.)*\"(?:[^\"\\\\]|\111111\\\\.)*)*)\\((?:[^()\\\\]|\\\\.)*\\)/$1 /osx";
-     Perl5Util commentMatcher = new Perl5Util();
-     result = commentMatcher.substitute(commentPat,input);
-     // This really needs to be =~ or Perl5Matcher comparison
-     while (!result.equals(input)) {
-        input = result;
-        result = commentMatcher.substitute(commentPat,input);
-     }
-     return result;
+     */
+    protected String stripComments(String emailStr) {
+        String input = emailStr;
+        String result = emailStr;
+        String commentPat = "s/^((?:[^\"\\\\]|\\\\.)*(?:\"(?:[^\"\\\\]|\\\\.)*\"(?:[^\"\\\\]|\111111\\\\.)*)*)\\((?:[^()\\\\]|\\\\.)*\\)/$1 /osx";
+        Perl5Util commentMatcher = new Perl5Util();
+        result = commentMatcher.substitute(commentPat, input);
+        // This really needs to be =~ or Perl5Matcher comparison
+        while (!result.equals(input)) {
+            input = result;
+            result = commentMatcher.substitute(commentPat, input);
+        }
+        return result;
 
     }
 }