[29/50] [abbrv] hadoop git commit: HADOOP-13602. Fix some warnings by findbugs in hadoop-maven-plugin. (ozawa)

2016-09-26 Thread jianhe
HADOOP-13602. Fix some warnings by findbugs in hadoop-maven-plugin. (ozawa)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8d619b48
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8d619b48
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8d619b48

Branch: refs/heads/MAPREDUCE-6608
Commit: 8d619b4896ac31f63fd0083594b6e7d207ef71a0
Parents: 537095d
Author: Tsuyoshi Ozawa 
Authored: Fri Sep 23 01:37:06 2016 +0900
Committer: Tsuyoshi Ozawa 
Committed: Fri Sep 23 01:37:06 2016 +0900

--
 .../maven/plugin/cmakebuilder/CompileMojo.java  |  4 +-
 .../maven/plugin/cmakebuilder/TestMojo.java |  4 +-
 .../hadoop/maven/plugin/protoc/ProtocMojo.java  |  4 ++
 .../apache/hadoop/maven/plugin/util/Exec.java   |  6 ++-
 .../plugin/versioninfo/VersionInfoMojo.java | 55 ++--
 5 files changed, 42 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d619b48/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
index afb11cb..0196352 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
@@ -14,6 +14,7 @@
 
 package org.apache.hadoop.maven.plugin.cmakebuilder;
 
+import java.util.Locale;
 import org.apache.hadoop.maven.plugin.util.Exec.OutputBufferThread;
 import org.apache.hadoop.maven.plugin.util.Exec;
 import org.apache.maven.plugin.AbstractMojo;
@@ -83,7 +84,8 @@ public class CompileMojo extends AbstractMojo {
 
   // TODO: support Windows
   private static void validatePlatform() throws MojoExecutionException {
-if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
+if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH)
+.startsWith("windows")) {
   throw new MojoExecutionException("CMakeBuilder does not yet support " +
   "the Windows platform.");
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d619b48/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
index e676efd..95b6264 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
@@ -14,6 +14,7 @@
 
 package org.apache.hadoop.maven.plugin.cmakebuilder;
 
+import java.util.Locale;
 import org.apache.hadoop.maven.plugin.util.Exec;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
@@ -117,7 +118,8 @@ public class TestMojo extends AbstractMojo {
 
   // TODO: support Windows
   private static void validatePlatform() throws MojoExecutionException {
-if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
+if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH)
+.startsWith("windows")) {
   throw new MojoExecutionException("CMakeBuilder does not yet support " +
   "the Windows platform.");
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d619b48/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
index 0dcac0e..df479fd 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
@@ -105,6 +105,10 @@ public class ProtocMojo extends AbstractMojo {
 private boolean hasDirectoryChanged(File directory) throws IOException {
   File[] listing = directory.listFiles();
   boolean changed = false;
+  if (listing == null) {
+// not changed.
+return false;
+  }
   // Do not exit early, since we need to compute and save checksums
   // for each file within the directory.
   for (File f : 

hadoop git commit: HADOOP-13602. Fix some warnings by findbugs in hadoop-maven-plugin. (ozawa)

2016-09-22 Thread ozawa
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 a0b076785 -> d73359382


HADOOP-13602. Fix some warnings by findbugs in hadoop-maven-plugin. (ozawa)

(cherry picked from commit 8d619b4896ac31f63fd0083594b6e7d207ef71a0)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d7335938
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d7335938
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d7335938

Branch: refs/heads/branch-2
Commit: d73359382e78aaa362c5ad9c3ff84859d4758a37
Parents: a0b0767
Author: Tsuyoshi Ozawa 
Authored: Fri Sep 23 01:37:06 2016 +0900
Committer: Tsuyoshi Ozawa 
Committed: Fri Sep 23 01:37:24 2016 +0900

--
 .../maven/plugin/cmakebuilder/CompileMojo.java  |  4 +-
 .../maven/plugin/cmakebuilder/TestMojo.java |  4 +-
 .../hadoop/maven/plugin/protoc/ProtocMojo.java  |  4 ++
 .../apache/hadoop/maven/plugin/util/Exec.java   |  6 ++-
 .../plugin/versioninfo/VersionInfoMojo.java | 55 ++--
 5 files changed, 42 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7335938/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
index afb11cb..0196352 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
@@ -14,6 +14,7 @@
 
 package org.apache.hadoop.maven.plugin.cmakebuilder;
 
+import java.util.Locale;
 import org.apache.hadoop.maven.plugin.util.Exec.OutputBufferThread;
 import org.apache.hadoop.maven.plugin.util.Exec;
 import org.apache.maven.plugin.AbstractMojo;
@@ -83,7 +84,8 @@ public class CompileMojo extends AbstractMojo {
 
   // TODO: support Windows
   private static void validatePlatform() throws MojoExecutionException {
-if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
+if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH)
+.startsWith("windows")) {
   throw new MojoExecutionException("CMakeBuilder does not yet support " +
   "the Windows platform.");
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7335938/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
index 447331b..6b44198 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
@@ -14,6 +14,7 @@
 
 package org.apache.hadoop.maven.plugin.cmakebuilder;
 
+import java.util.Locale;
 import org.apache.hadoop.maven.plugin.util.Exec;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
@@ -111,7 +112,8 @@ public class TestMojo extends AbstractMojo {
 
   // TODO: support Windows
   private static void validatePlatform() throws MojoExecutionException {
-if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
+if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH)
+.startsWith("windows")) {
   throw new MojoExecutionException("CMakeBuilder does not yet support " +
   "the Windows platform.");
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/d7335938/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
index 0dcac0e..df479fd 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
@@ -105,6 +105,10 @@ public class ProtocMojo extends AbstractMojo {
 private boolean hasDirectoryChanged(File directory) throws IOException {
   File[] listing = directory.listFiles();
   boolean changed = false;
+  if (listing == null) {
+// not changed.
+return false;
+ 

hadoop git commit: HADOOP-13602. Fix some warnings by findbugs in hadoop-maven-plugin. (ozawa)

2016-09-22 Thread ozawa
Repository: hadoop
Updated Branches:
  refs/heads/trunk 537095d13 -> 8d619b489


HADOOP-13602. Fix some warnings by findbugs in hadoop-maven-plugin. (ozawa)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8d619b48
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8d619b48
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8d619b48

Branch: refs/heads/trunk
Commit: 8d619b4896ac31f63fd0083594b6e7d207ef71a0
Parents: 537095d
Author: Tsuyoshi Ozawa 
Authored: Fri Sep 23 01:37:06 2016 +0900
Committer: Tsuyoshi Ozawa 
Committed: Fri Sep 23 01:37:06 2016 +0900

--
 .../maven/plugin/cmakebuilder/CompileMojo.java  |  4 +-
 .../maven/plugin/cmakebuilder/TestMojo.java |  4 +-
 .../hadoop/maven/plugin/protoc/ProtocMojo.java  |  4 ++
 .../apache/hadoop/maven/plugin/util/Exec.java   |  6 ++-
 .../plugin/versioninfo/VersionInfoMojo.java | 55 ++--
 5 files changed, 42 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d619b48/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
index afb11cb..0196352 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java
@@ -14,6 +14,7 @@
 
 package org.apache.hadoop.maven.plugin.cmakebuilder;
 
+import java.util.Locale;
 import org.apache.hadoop.maven.plugin.util.Exec.OutputBufferThread;
 import org.apache.hadoop.maven.plugin.util.Exec;
 import org.apache.maven.plugin.AbstractMojo;
@@ -83,7 +84,8 @@ public class CompileMojo extends AbstractMojo {
 
   // TODO: support Windows
   private static void validatePlatform() throws MojoExecutionException {
-if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
+if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH)
+.startsWith("windows")) {
   throw new MojoExecutionException("CMakeBuilder does not yet support " +
   "the Windows platform.");
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d619b48/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
index e676efd..95b6264 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/TestMojo.java
@@ -14,6 +14,7 @@
 
 package org.apache.hadoop.maven.plugin.cmakebuilder;
 
+import java.util.Locale;
 import org.apache.hadoop.maven.plugin.util.Exec;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
@@ -117,7 +118,8 @@ public class TestMojo extends AbstractMojo {
 
   // TODO: support Windows
   private static void validatePlatform() throws MojoExecutionException {
-if (System.getProperty("os.name").toLowerCase().startsWith("windows")) {
+if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH)
+.startsWith("windows")) {
   throw new MojoExecutionException("CMakeBuilder does not yet support " +
   "the Windows platform.");
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8d619b48/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
--
diff --git 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
index 0dcac0e..df479fd 100644
--- 
a/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
+++ 
b/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/protoc/ProtocMojo.java
@@ -105,6 +105,10 @@ public class ProtocMojo extends AbstractMojo {
 private boolean hasDirectoryChanged(File directory) throws IOException {
   File[] listing = directory.listFiles();
   boolean changed = false;
+  if (listing == null) {
+// not changed.
+return false;
+  }
   // Do not exit early, since we need to compute and save checksums