directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <kayyag...@apache.org>
Subject Re: Suspicius code in SyncReplRequestHandler
Date Thu, 23 May 2013 17:55:56 GMT
On Thu, May 23, 2013 at 7:12 PM, Emmanuel L├ęcharny <elecharny@gmail.com>wrote:

> Hi Kiran,
>
> while looking at Sonar reports
> (https://analysis.apache.org/drilldown/violations), I found a weird
> piece of code, which is likely ot be an error in SyncReplRequestHandler :
>
>     private void sendContentFromLog( LdapSession session, SearchRequest
> req, ReplicaEventLog clientMsgLog,
>         String fromCsn )
>         throws Exception
>     {
>     ...
>                 switch ( event )
>                 {
>                     case ADD:
>                         syncStateType = SyncStateTypeEnum.ADD;
>                         break;
>
>                     case MODIFY:
>                         syncStateType = SyncStateTypeEnum.MODIFY;
>                         break;
>
>                     case MODDN:
>                         syncStateType = SyncStateTypeEnum.MODDN;
> <<<<--------------- No break, so the syncStateType will switch to DELETE
>
>                     case DELETE:
>                         syncStateType = SyncStateTypeEnum.DELETE;
>                         break;
>                 }
>
> Am I correct to think that we must add a break ?
>
> yes, this is clearly a big mistake (which I guess might have resulted from
a merge from keydap source)
thanks for finding

> --
> Regards,
> Cordialement,
> Emmanuel L├ęcharny
> www.iktek.com
>
>


-- 
Kiran Ayyagari
http://keydap.com

Mime
View raw message