From 469bc02c6f932bc55fced96de33884cebbe92242 Mon Sep 17 00:00:00 2001 From: Niccolo Becchi Date: Fri, 24 Jun 2016 14:50:24 +0100 Subject: [PATCH 1/2] HADOOP-13320. Fix arguments check in the WordCount v2.0 in Doc. Contributed by Niccolo Becchi --- .../src/site/markdown/MapReduceTutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md index 16f3afb988075..ea67f45388074 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md @@ -1040,7 +1040,7 @@ public class WordCount2 { Configuration conf = new Configuration(); GenericOptionsParser optionParser = new GenericOptionsParser(conf, args); String[] remainingArgs = optionParser.getRemainingArgs(); - if (!(remainingArgs.length != 2 | | remainingArgs.length != 4)) { + if (!(remainingArgs.length == 2 || remainingArgs.length == 4)) { System.err.println("Usage: wordcount [-skip skipPatternFile]"); System.exit(2); } From bd83b58df7aee8cf3b91566acc2b09f000d245ee Mon Sep 17 00:00:00 2001 From: Niccolo Becchi Date: Fri, 1 Jul 2016 18:08:05 +0100 Subject: [PATCH 2/2] HADOOP-13320. Fix arguments check in the WordCount v2.0: simplified the logic a little --- .../src/site/markdown/MapReduceTutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md index ea67f45388074..8f2c0b9e2ee1e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/site/markdown/MapReduceTutorial.md @@ -1040,7 +1040,7 @@ public class WordCount2 { Configuration conf = new Configuration(); GenericOptionsParser optionParser = new GenericOptionsParser(conf, args); String[] remainingArgs = optionParser.getRemainingArgs(); - if (!(remainingArgs.length == 2 || remainingArgs.length == 4)) { + if ((remainingArgs.length != 2) && (remainingArgs.length != 4)) { System.err.println("Usage: wordcount [-skip skipPatternFile]"); System.exit(2); }