directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@gmail.com>
Subject Suspicius code in SyncReplRequestHandler
Date Thu, 23 May 2013 13:42:08 GMT
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 ?

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


Mime
View raw message