You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2019/01/06 20:43:00 UTC

[jira] [Commented] (NUTCH-2475) If and else-if branches has the same condition

    [ https://issues.apache.org/jira/browse/NUTCH-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16735326#comment-16735326 ] 

Hudson commented on NUTCH-2475:
-------------------------------

SUCCESS: Integrated in Jenkins build Nutch-nutchgora #1629 (See [https://builds.apache.org/job/Nutch-nutchgora/1629/])
NUTCH-2475 If and else-if branches has the same condition - remove (snagel: [https://github.com/apache/nutch/commit/e56f82d9178ecb1de1147c73d9c0c9a55ed63ec3])
* (edit) src/plugin/protocol-ftp/src/java/org/apache/nutch/protocol/ftp/Client.java


> 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, protocol
>    Affects Versions: 2.2, 1.14
>            Reporter: songwanging
>            Assignee: Sebastian Nagel
>            Priority: Minor
>             Fix For: 2.4, 1.16
>
>
> 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
(v7.6.3#76005)