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

If and else-if branches has the same condition

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-RC2
    • Fix Version/s: 2.0.0.AM3
    • Labels:
      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: