Author: sharad
Date: Wed Aug 26 12:50:25 2009
New Revision: 807986
URL: http://svn.apache.org/viewvc?rev=807986&view=rev
Log:
HADOOP-6213. Remove commons dependency on commons-cli2. Contributed by Amar
Kamat.
Removed:
hadoop/common/branches/branch-0.20/lib/commons-cli-2.0-SNAPSHOT.jar
Modified:
hadoop/common/branches/branch-0.20/CHANGES.txt
hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
Modified: hadoop/common/branches/branch-0.20/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/CHANGES.txt?rev=807986&r1=807985&r2=807986&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20/CHANGES.txt Wed Aug 26 12:50:25 2009
@@ -235,6 +235,9 @@
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
Modified:
hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
URL:
http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java?rev=807986&r1=807985&r2=807986&view=diff
==============================================================================
---
hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
(original)
+++
hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/util/GenericOptionsParser.java
Wed Aug 26 12:50:25 2009
@@ -205,8 +205,7 @@
.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 @@
}
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);