directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1572460 - /directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
Date Thu, 27 Feb 2014 07:47:15 GMT
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;



Mime
View raw message