From 30d42a768fa03675ea19688ce25ee604ca9a1ea4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Apr 2017 16:49:30 +0200 Subject: [PATCH] removed noisy debug lines, no more need for them MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../jusercore/model/user/UserUtils.java | 42 ++++--------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/src/org/mxchange/jusercore/model/user/UserUtils.java b/src/org/mxchange/jusercore/model/user/UserUtils.java index 7b3898a..27326a7 100644 --- a/src/org/mxchange/jusercore/model/user/UserUtils.java +++ b/src/org/mxchange/jusercore/model/user/UserUtils.java @@ -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 *

- * @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 *

* @return Whether the password matches @@ -485,8 +456,8 @@ public class UserUtils implements Serializable { /** * Checks if direct password the updatedUser's password *

- * @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 *

* @return Whether the password matches */ @@ -541,7 +512,7 @@ public class UserUtils implements Serializable { * Checks if the regular expression is found in given string *

* @param pattern Regular expression - * @param str String + * @param str String *

* @return Whether it is found */ @@ -573,4 +544,5 @@ public class UserUtils implements Serializable { */ private UserUtils () { } + } -- 2.39.5