You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2006/05/16 12:25:05 UTC

Re: svn commit: r406888 - /directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java

Thanks ersin !

btw, could you replace
 if ( bool.equals( "true" ) )

by
 if ( "true".equalsIgnorecase( bool ) )

?


On 5/16/06, ersiner@apache.org <er...@apache.org> wrote:
> 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;
> +    }
> +
>  }
>
>
>


-- 
Cordialement,
Emmanuel Lécharny

Re: svn commit: r406888 - /directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java

Posted by Emmanuel Lecharny <el...@gmail.com>.
ah, sorry ! I thought it was permanent.

Thanks for the fix !

On 5/16/06, Ersin Er <er...@gmail.com> wrote:
> Emmanuel Lecharny wrote:
> > Thanks ersin !
> >
> > btw, could you replace
> > if ( bool.equals( "true" ) )
> >
> > by
> > if ( "true".equalsIgnorecase( bool ) )
> >
> > ?
> I had added it just as a quick fix for the compilation problem. I would
> like to use shared/ldap/utils/BooleanUtils instead of the hack but
> shared-ldap is not yet a dependeny for kerberos-shared.
>
> Anyways I've recommitted.
>
> Cheers,
>
> --
> Ersin
> >
> > On 5/16/06, ersiner@apache.org <er...@apache.org> wrote:
> >> 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;
> >> +    }
> >> +
> >>  }
> >>
> >>
> >>
> >
> >
>
>


-- 
Cordialement,
Emmanuel Lécharny

Re: svn commit: r406888 - /directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetPrincipal.java

Posted by Ersin Er <er...@gmail.com>.
Emmanuel Lecharny wrote:
> Thanks ersin !
>
> btw, could you replace
> if ( bool.equals( "true" ) )
>
> by
> if ( "true".equalsIgnorecase( bool ) )
>
> ?
I had added it just as a quick fix for the compilation problem. I would 
like to use shared/ldap/utils/BooleanUtils instead of the hack but 
shared-ldap is not yet a dependeny for kerberos-shared.

Anyways I've recommitted.

Cheers,

-- 
Ersin
>
> On 5/16/06, ersiner@apache.org <er...@apache.org> wrote:
>> 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;
>> +    }
>> +
>>  }
>>
>>
>>
>
>