]> git.mxchange.org Git - juser-core.git/commitdiff
removed noisy debug lines, no more need for them
authorRoland Häder <roland@mxchange.org>
Thu, 20 Apr 2017 14:49:30 +0000 (16:49 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 20 Apr 2017 14:49:30 +0000 (16:49 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jusercore/model/user/UserUtils.java

index 7b3898a703dd63e14e699f84835d242ae4691bfe..27326a7b26b825184b5f0a5ce2ded1957c1ab4db 100644 (file)
@@ -58,7 +58,7 @@ public class UserUtils implements Serializable {
        };
 
        /**
-        * Minimum password length
+        * Hard-coded minimum password length
         */
        private static final Integer PASSWORD_MINIMUM_LENGTH = 5;
 
@@ -119,9 +119,6 @@ public class UserUtils implements Serializable {
         * @return Strength of password
         */
        public static double calculatePasswordScore (final String password) {
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: password=" + password + " - CALLED!"); //NOI18N
-
                // Should not be null
                if (null == password) {
                        // Throw NPE
@@ -137,71 +134,44 @@ public class UserUtils implements Serializable {
                //password length
                score += password.length() * calculateEntropyFactor(password) / 100;
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after length"); //NOI18N
-
                //password has 3 numbers
                if (ifRegExFoundInString("(.*[0-9].*[0-9].*[0-9].*)+", password)) { //NOI18N
                        score += 5;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after 3 numbers"); //NOI18N
-
                //password has 2 symbols
                if (ifRegExFoundInString("(.*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*)+", password)) { //NOI18N
                        score += 5;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after 2 symbols"); //NOI18N
-
                //password has Upper and Lower chars
                if (ifRegExFoundInString("(.*[a-z].*[A-Z])|([A-Z].*[a-z].*)+", password)) { //NOI18N
                        score += 10;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after upper/lower"); //NOI18N
-
                //password has number and chars
                if (ifRegExFoundInString("(.*[a-zA-Z].*)+", password) && ifRegExFoundInString("(.*[0-9].*)+", password)) { //NOI18N
                        score += 15;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after number+chars"); //NOI18N
-
                //password has number and symbol
                if (ifRegExFoundInString("(.*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*)+", password) && ifRegExFoundInString("(.*[0-9].*)+", password)) { //NOI18N
                        score += 15;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after number+symbol"); //NOI18N
-
                //password has char and symbol
                if (ifRegExFoundInString("(.*[!,@,#,$,%,^,&,*,/,?,_,~,=,.,-,;,:].*)+", password) && ifRegExFoundInString("(.*[a-zA-Z].*)+", password)) { //NOI18N
                        score += 15;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after char+symbol"); //NOI18N
-
                //password is just numbers or chars
                if (ifRegExFoundInString("^[a-zA-Z]+$", password) || ifRegExFoundInString("^[0-9]+$", password)) { //NOI18N
                        score -= 10;
                }
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - after number/char"); //NOI18N
-
                // Larger than 100 is not allowed
                score = Math.max(Math.min(score, 100.0f), 0.0f);
 
-               // Log message
-               System.out.println(UserUtils.class.getSimpleName() + ".calculatePasswordScore: score=" + score + " - EXIT!"); //NOI18N
-
                // Return it
                return score;
        }
@@ -454,7 +424,8 @@ public class UserUtils implements Serializable {
        /**
         * Checks if password from container matches the updatedUser's password
         * <p>
-        * @param container Container holding user instance and unencrypted password
+        * @param container   Container holding user instance and clear-text
+        *                    password
         * @param updatedUser Updated user instance from database
         * <p>
         * @return Whether the password matches
@@ -485,8 +456,8 @@ public class UserUtils implements Serializable {
        /**
         * Checks if direct password the updatedUser's password
         * <p>
-        * @param unencryptedPassword Unencrypted (direct) password
-        * @param updatedUser Updated user instance from database
+        * @param unencryptedPassword Clear-text (direct) password
+        * @param updatedUser         Updated user instance from database
         * <p>
         * @return Whether the password matches
         */
@@ -541,7 +512,7 @@ public class UserUtils implements Serializable {
         * Checks if the regular expression is found in given string
         * <p>
         * @param pattern Regular expression
-        * @param str String
+        * @param str     String
         * <p>
         * @return Whether it is found
         */
@@ -573,4 +544,5 @@ public class UserUtils implements Serializable {
         */
        private UserUtils () {
        }
+
 }