Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-303

If and else-if branches has the same condition

Attach filesAttach ScreenshotWatch issueCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0-RC2
    • 2.0.0.AM3
    • None

    Description

      Our tool DeepTect has detected a piece of buggy code snippet, in which the if and else branches has the same condition.

      Path: directory-ldap-api/util/src/main/java/org/apache/directory/api/util/Unicode.java

      public static char bytesToChar( byte[] bytes, int pos ){
      ...
         else if ( ( bytes[pos] & UTF8_FIVE_BYTES_MASK ) == UTF8_FIVE_BYTES ){
                   // Five bytes char
                   ...
          }
         else if ( ( bytes[pos] & UTF8_FIVE_BYTES_MASK ) == UTF8_FIVE_BYTES ){
                      // Six bytes char
                       ...
                  }
      
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            songwang songwanging
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment