You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2014/02/27 08:47:15 UTC

svn commit: r1572460 - /directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java

Author: kayyagari
Date: Thu Feb 27 07:47:14 2014
New Revision: 1572460

URL: http://svn.apache.org/r1572460
Log:
o fixed a typo in a log statement
o formatted code block for better readability

Modified:
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1572460&r1=1572459&r2=1572460&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Thu Feb 27 07:47:14 2014
@@ -1320,7 +1320,7 @@ public class AuthenticationInterceptor e
         {
             if ( pwdLen < minLen )
             {
-                throw new PasswordPolicyException( "Password should have a minmum of " + minLen + " characters",
+                throw new PasswordPolicyException( "Password should have a minimum of " + minLen + " characters",
                     PASSWORD_TOO_SHORT.getValue() );
             }
         }
@@ -1371,8 +1371,14 @@ public class AuthenticationInterceptor e
 
         if ( pwdAge >= warningAge )
         {
-            long timeBeforeExpiration = ((long)policyConfig.getPwdMaxAge()) - pwdAge;
-            return timeBeforeExpiration > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)timeBeforeExpiration;
+            long timeBeforeExpiration = ( ( long ) policyConfig.getPwdMaxAge() ) - pwdAge;
+            
+            if ( timeBeforeExpiration > Integer.MAX_VALUE )
+            {
+                timeBeforeExpiration = Integer.MAX_VALUE;
+            }
+            
+            return ( int ) timeBeforeExpiration;
         }
 
         return 0;