FAQ
I was playing around with PMD, just to see what kind of messages it
gives on my hadoop feature.
I noticed a message about "Dead code" in org.apache.hadoop.fs.ftp.FTPFileSystem

Starting at about line 80:

String userAndPassword = uri.getUserInfo();
if (userAndPassword == null) {
userAndPassword = (conf.get("fs.ftp.user." + host, null) + ":" + conf
.get("fs.ftp.password." + host, null));
if (userAndPassword == null) {
throw new IOException("Invalid user/passsword specified");
}
}


The last "if" block is the dead code as the string will always contain
at least the text ":" or "null:null"
It will probably fail a bit later when really trying to login with a
wrong uid/password.
So, is this worth reporting as a bug?

--
Met vriendelijke groeten,

Niels Basjes

Search Discussions

  • Konstantin Boudnik at Jan 29, 2011 at 9:03 pm
    Yes, please do. Thanks for looking into this.
    --
    Take care,
    Konstantin (Cos) Boudnik


    On Sat, Jan 29, 2011 at 12:44, Niels Basjes wrote:
    I was playing around with PMD, just to see what kind of messages it
    gives on my hadoop feature.
    I noticed a message about "Dead code" in org.apache.hadoop.fs.ftp.FTPFileSystem

    Starting at about line 80:

    String userAndPassword = uri.getUserInfo();
    if (userAndPassword == null) {
    userAndPassword = (conf.get("fs.ftp.user." + host, null) + ":" + conf
    .get("fs.ftp.password." + host, null));
    if (userAndPassword == null) {
    throw new IOException("Invalid user/passsword specified");
    }
    }


    The last "if" block is the dead code as the string will always contain
    at least the text ":" or "null:null"
    It will probably fail a bit later when really trying to login with a
    wrong uid/password.
    So, is this worth reporting as a bug?

    --
    Met vriendelijke groeten,

    Niels Basjes
  • Niels Basjes at Jan 29, 2011 at 11:17 pm
    Done,
    https://issues.apache.org/jira/browse/HADOOP-7127

    2011/1/29 Konstantin Boudnik <cos@apache.org>:
    Yes, please do. Thanks for looking into this.
    --
    Take care,
    Konstantin (Cos) Boudnik


    On Sat, Jan 29, 2011 at 12:44, Niels Basjes wrote:
    I was playing around with PMD, just to see what kind of messages it
    gives on my hadoop feature.
    I noticed a message about "Dead code" in org.apache.hadoop.fs.ftp.FTPFileSystem

    Starting at about line 80:

    String userAndPassword = uri.getUserInfo();
    if (userAndPassword == null) {
    userAndPassword = (conf.get("fs.ftp.user." + host, null) + ":" + conf
    .get("fs.ftp.password." + host, null));
    if (userAndPassword == null) {
    throw new IOException("Invalid user/passsword specified");
    }
    }


    The last "if" block is the dead code as the string will always contain
    at least the text ":" or "null:null"
    It will probably fail a bit later when really trying to login with a
    wrong uid/password.
    So, is this worth reporting as a bug?

    --
    Met vriendelijke groeten,

    Niels Basjes


    --
    Met vriendelijke groeten,

    Niels Basjes

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedJan 29, '11 at 8:45p
activeJan 29, '11 at 11:17p
posts3
users2
websitehadoop.apache.org...
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase