directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r406888 - /directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
Date Tue, 16 May 2006 09:58:44 GMT
Author: ersiner
Date: Tue May 16 02:58:43 2006
New Revision: 406888

URL: http://svn.apache.org/viewcvs?rev=406888&view=rev
Log:
Removed 1.5 dep by replacing Boolean.parseBoolean with custom implementation.
It's better to move this simple method to a common place though.

Modified:
    directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java

Modified: directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java?rev=406888&r1=406887&r2=406888&view=diff
==============================================================================
--- directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
(original)
+++ directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java
Tue May 16 02:58:43 2006
@@ -126,13 +126,13 @@
         if ( attrs.get( KerberosAttribute.ACCOUNT_DISABLED ) != null )
         {
             String val = ( String ) attrs.get( KerberosAttribute.ACCOUNT_DISABLED ).get();

-            modifier.setDisabled( Boolean.parseBoolean( val.toLowerCase() ) );
+            modifier.setDisabled( parseBoolean( val.toLowerCase() ) );
         }
 
         if ( attrs.get( KerberosAttribute.ACCOUNT_LOCKEDOUT ) != null )
         {
             String val = ( String ) attrs.get( KerberosAttribute.ACCOUNT_LOCKEDOUT ).get();

-            modifier.setLockedOut( Boolean.parseBoolean( val.toLowerCase() ) );
+            modifier.setLockedOut( parseBoolean( val.toLowerCase() ) );
         }
         
         if ( attrs.get( KerberosAttribute.ACCOUNT_EXPIRATION_TIME ) != null )
@@ -173,4 +173,18 @@
         modifier.setKeyVersionNumber( Integer.parseInt( keyVersionNumber ) );
         return modifier.getEntry();
     }
+    
+    /**
+     * TODO: It's better to move this method to a common place.
+     */
+    private static boolean parseBoolean( String bool )
+    {
+        if ( bool.equals( "true" ) )
+        {
+            return true;
+        }
+
+        return false;
+    }
+    
 }



Mime
View raw message