Permalink
Browse files

HADOOP-6213. Remove commons dependency on commons-cli2. Contributed b…

…y Amar Kamat.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20@807986 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 3ca7bcf commit 62186a1816d14501c5d187bbb7d4a1388357ae7b @sharadag sharadag committed Aug 26, 2009
View
@@ -235,6 +235,9 @@ Release 0.20.1 - Unreleased
mapred.system.dir in the JobTracker. The JobTracker will bail out if it
encounters such an exception. (Amar Kamat via ddas)
+ HADOOP-6213. Remove commons dependency on commons-cli2. (Amar Kamat via
+ sharad)
+
Release 0.20.0 - 2009-04-15
INCOMPATIBLE CHANGES
Binary file not shown.
@@ -205,8 +205,7 @@ private static Options buildGeneralOptions(Options opts) {
.withDescription("specify an application configuration file")
.create("conf");
Option property = OptionBuilder.withArgName("property=value")
- .hasArgs()
- .withArgPattern("=", 1)
+ .hasArg()
.withDescription("use value for given property")
.create('D');
Option libjars = OptionBuilder.withArgName("paths")
@@ -281,9 +280,11 @@ private void processGeneralOptions(Configuration conf,
}
if (line.hasOption('D')) {
String[] property = line.getOptionValues('D');
- for(int i=0; i<property.length-1; i=i+2) {
- if (property[i]!=null)
- conf.set(property[i], property[i+1]);
+ for(String prop : property) {
+ String[] keyval = prop.split("=");
+ if (keyval.length == 2) {
+ conf.set(keyval[0], keyval[1]);
+ }
}
}
conf.setBoolean("mapred.used.genericoptionsparser", true);

0 comments on commit 62186a1

Please sign in to comment.