Author: cnauroth Date: Thu Nov 14 17:49:33 2013 New Revision: 1541993 URL: http://svn.apache.org/r1541993 Log: HADOOP-10094. Merging change r1541991 from trunk to branch-2.
Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1541993&r1=1541992&r2=1541993&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Thu Nov 14 17:49:33 2013 @@ -143,6 +143,9 @@ Release 2.3.0 - UNRELEASED HADOOP-10093. hadoop-env.cmd sets HADOOP_CLIENT_OPTS with a max heap size that is too small. (Shanyu Zhao via cnauroth) + HADOOP-10094. NPE in GenericOptionsParser#preProcessForWindows(). + (Enis Soztutar via cnauroth) + Release 2.2.1 - UNRELEASED INCOMPATIBLE CHANGES Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java?rev=1541993&r1=1541992&r2=1541993&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java Thu Nov 14 17:49:33 2013 @@ -431,6 +431,9 @@ public class GenericOptionsParser { if (!Shell.WINDOWS) { return args; } + if (args == null) { + return null; + } List<String> newArgs = new ArrayList<String>(args.length); for (int i=0; i < args.length; i++) { String prop = null; Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java?rev=1541993&r1=1541992&r2=1541993&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestGenericOptionsParser.java Thu Nov 14 17:49:33 2013 @@ -282,4 +282,12 @@ public class TestGenericOptionsParser ex Arrays.toString(remainingArgs) + Arrays.toString(expectedRemainingArgs), expectedRemainingArgs, remainingArgs); } + + /** Test passing null as args. Some classes still call + * Tool interface from java passing null. + */ + public void testNullArgs() throws IOException { + GenericOptionsParser parser = new GenericOptionsParser(conf, null); + parser.getRemainingArgs(); + } }