05-16-06 12:11 PM
Thanks ersin !
btw, could you replace
if ( bool.equals( "true" ) )
by
if ( "true".equalsIgnorecase( bool ) )
?
On 5/16/06, ersiner-1oDqGaOF3Lkdnm+yROfE0A@public.gmane.org <ersiner-1oDqGaOF3Lkdnm+yROfE0A@
public.gmane.org> wrote:
> Author: ersiner
> Date: Tue May 16 02:58:43 2006
> New Revision: 406888
>
> URL: http://svn.apache.org/viewcvs?rev=3D406888&view=3Drev
> Log:
> Removed 1.5 dep by replacing Boolean.parseBoolean with custom implementat=
ion.
> It's better to move this simple method to a common place though.
>
> Modified:
> directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/di=
rectory/server/kerberos/shared/store/operations/GetPrincipal.java
>
> Modified: directory/trunks/apacheds/kerberos-shared/src/main/java/org/apa=
che/directory/server/kerberos/shared/store/operations/GetPrincipal.java
> URL: http://svn.apache.org/viewcvs/direc...s/kerberos-sha=
red/src/main/java/org/apache/directory/server/kerberos/shared/store/operati=
ons/GetPrincipal.java?rev=3D406888&r1=3D406887&r2=3D406888&view=3Ddiff
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/di=
rectory/server/kerberos/shared/store/operations/GetPrincipal.java (original=
)
> +++ directory/trunks/apacheds/kerberos-shared/src/main/java/org/apache/di=
rectory/server/kerberos/shared/store/operations/GetPrincipal.java Tue May 1=
6 02:58:43 2006
> @@ -126,13 +126,13 @@
> if ( attrs.get( KerberosAttribute.ACCOUNT_DISABLED ) !=3D null )
> {
> String val =3D ( String ) attrs.get( KerberosAttribute.ACCOU=
NT_DISABLED ).get();
> - modifier.setDisabled( Boolean.parseBoolean( val.toLowerCase(=
) ) );
> + modifier.setDisabled( parseBoolean( val.toLowerCase() ) );
> }
>
> if ( attrs.get( KerberosAttribute.ACCOUNT_LOCKEDOUT ) !=3D null =
)
> {
> String val =3D ( String ) attrs.get( KerberosAttribute.ACCOU=
NT_LOCKEDOUT ).get();
> - modifier.setLockedOut( Boolean.parseBoolean( val.toLowerCase=
() ) );
> + modifier.setLockedOut( parseBoolean( val.toLowerCase() ) );
> }
>
> if ( attrs.get( KerberosAttribute.ACCOUNT_EXPIRATION_TIME ) !=3D=
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;
> + }
> +
> }
>
>
>
--=20
Cordialement,
Emmanuel L=E9charny
[ Post a follow-up to this message ]
|