Lei (Eddy) Xu created HDFS-10551:
------------------------------------
Summary: o.a.h.h.s.diskbalancer.command.Command does not actually
verify options as expected.
Key: HDFS-10551
URL: https://issues.apache.org/jira/browse/HDFS-10551
Project: Hadoop HDFS
Issue Type: Sub-task
Reporter: Lei (Eddy) Xu
Priority: Critical
In {{diskbalancer.command.Command#verifyCommandOptions}}. The following code
does not do what it expected to do:
{code}
if (!validArgs.containsKey(opt.getArgName())) {
{code}
opt.getArgName() always returns "arg" instead of i.e., {{report}} or {{uri}},
which is the expected parameter to check.
It should use {{opt.getLongOpt()}} to get the option names. It can pass on the
branch because {{opt.getArgName()}} always returns {{"arg"}}, which is
accidently in {{validArgs}}. However I don't think it is the intention for this
function.
Additionally, in the following code
{code}
validArguments.append("Valid arguments are : %n");
{code}
This {{%n}} is not used.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]