Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-2475

If and else-if branches has the same condition

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2, 1.14
    • Fix Version/s: 2.4, 1.16
    • Component/s: plugin, protocol
    • 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: nutch/src/plugin/protocol-ftp/src/java/org/apache/nutch/protocol/ftp/Client.java

      private boolean _notBadReply(int reply) {
      
          if (FTPReply.isPositiveCompletion(reply)) {
            // do nothing
       ...
          } else if (reply == 451) { // FTPReply.ACTION_ABORTED
            // some ftp servers reply 451, e.g.,
            // ProFTPD [ftp.kernel.org]
            // there is second reply witing? no!
            // getReply();
          } else if (reply == 451) { // FTPReply.ACTION_ABORTED
          } else {
            // what other kind of ftp server out there?
            return false;
          }
      
          return true;
        }
      

        Attachments

          Activity

            People

            • Assignee:
              snagel Sebastian Nagel
              Reporter:
              songwang songwanging
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: