songwanging created NUTCH-2475:
----------------------------------
Summary: If and else-if branches has the same condition
Key: NUTCH-2475
URL: https://issues.apache.org/jira/browse/NUTCH-2475
Project: Nutch
Issue Type: Bug
Components: plugin
Affects Versions: 2.2
Reporter: songwanging
Priority: Minor
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
{code: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;
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)