You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2015/05/31 09:14:55 UTC
svn commit: r1682683 -
/directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
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 );
+ }
}
}
}
Re: svn commit: r1682683 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 31/05/15 16:48, Emmanuel Lécharny a écrit :
> Le 31/05/15 16:25, Stefan Seelmann a écrit :
>> Hi Emmanuel, just FYI, I @Ignore the TimeLimitWrapperTest because it
>> fails, can you please have a look?
> Ah, sorry, my bad ! I haven't checked the tests before committing my
> last changes.
>
> I'll commit a fixed version in a few minutes.
>
Stefan, I just committed the fixed tests.
I also fixed some antlr file with some missing imports.
Re: svn commit: r1682683 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 31/05/15 16:25, Stefan Seelmann a écrit :
> Hi Emmanuel, just FYI, I @Ignore the TimeLimitWrapperTest because it
> fails, can you please have a look?
Ah, sorry, my bad ! I haven't checked the tests before committing my
last changes.
I'll commit a fixed version in a few minutes.
Re: svn commit: r1682683 - /directory/studio/trunk/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitWrapper.java
Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
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 );
> + }
> }
> }
> }
>
>