directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <m...@stefan-seelmann.de>
Subject Re: svn commit: r1682683 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
Date Sun, 31 May 2015 14:25:31 GMT
Hi Emmanuel, just FYI, I @Ignore the TimeLimitWrapperTest because it
fails, can you please have a look?

Kind Regards,
Stefan


On 05/31/2015 09:14 AM, elecharny@apache.org wrote:
> Author: elecharny
> Date: Sun May 31 07:14:55 2015
> New Revision: 1682683
> 
> URL: http://svn.apache.org/r1682683
> Log:
> Fixed some corner cases for time limit (hard=0 or hard < soft)
> 
> Modified:
>     directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
> 
> Modified: directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
> URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java?rev=1682683&r1=1682682&r2=1682683&view=diff
> ==============================================================================
> --- directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
(original)
> +++ directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
Sun May 31 07:14:55 2015
> @@ -460,7 +460,7 @@ public class TimeLimitWrapper
>          
>          if ( globalLimit != null )
>          {
> -            // The globalLimoit overrides the soft and hard limit
> +            // The globalLioit overrides the soft and hard limit
>              sb.append( "time=" );
>              
>              if ( globalLimit == -1 )
> @@ -481,7 +481,7 @@ public class TimeLimitWrapper
>                  {
>                      if ( hardLimit.equals( softLimit ) )
>                      {
> -                        // If hard and soft are set and equals, e use the global limit
instead
> +                        // If hard and soft are set and equals, we use the global limit
instead
>                          sb.append( "time=" );
>                          
>                          if ( hardLimit == -1 )
> @@ -495,27 +495,40 @@ public class TimeLimitWrapper
>                      }
>                      else
>                      {
> -                        // We have both values
> -                        sb.append( "time.hard=" );
> -                        
> -                        if ( hardLimit == -1 )
> -                        {
> -                            sb.append( "unlimited" );
> -                        }
> -                        else if ( hardLimit >= 0 )
> +                        // We have both values. 
> +                        if ( hardLimit == UNLIMITED )
>                          {
> -                            sb.append( hardLimit );
> -                        }
> -
> -                        sb.append( " time.soft=" );
> -                        
> -                        if ( softLimit == -1 )
> -                        {
> -                            sb.append( "unlimited" );
> +                            sb.append( "time.hard=unlimited" );
>                          }
> -                        else if ( softLimit >= 0 )
> +                        else if ( ( hardLimit.intValue() == 0 ) || ( hardLimit.intValue()
< softLimit.intValue() ) )
>                          {
> -                            sb.append( softLimit );
> +                            // Special cases : hard = soft
> +                            // or hard limit should be higher than soft limit : use
the short limit
> +                            sb.append( "time=" ).append( softLimit );
> +                        }
> +                        else 
> +                        {
> +                            sb.append( "time.hard=" );
> +                            
> +                            if ( hardLimit == -1 )
> +                            {
> +                                sb.append( "unlimited" );
> +                            }
> +                            else if ( hardLimit > 0 )
> +                            {
> +                                sb.append( hardLimit );
> +                            }
> +    
> +                            sb.append( " time.soft=" );
> +                            
> +                            if ( softLimit == -1 )
> +                            {
> +                                sb.append( "unlimited" );
> +                            }
> +                            else if ( softLimit >= 0 )
> +                            {
> +                                sb.append( softLimit );
> +                            }
>                          }
>                      }
>                  }
> 
> 


Mime
View raw message