hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [34/50] hadoop git commit: HADOOP-12378. Fix findbugs warnings in hadoop-tools module. Contributed by Akira AJISAKA.
Date Tue, 03 May 2016 22:06:21 GMT
HADOOP-12378. Fix findbugs warnings in hadoop-tools module. Contributed by Akira AJISAKA.

(cherry picked from commit ef0870ad038a1b72ea14ce550e34139b81eb901b)


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

Branch: refs/heads/branch-2.8
Commit: 50d06acb0992eb63215a67e695e85bc4f3313d0f
Parents: 5ba79d7
Author: Masatake Iwasaki <iwasakims@apache.org>
Authored: Fri Apr 29 20:25:52 2016 +0900
Committer: Masatake Iwasaki <iwasakims@apache.org>
Committed: Fri Apr 29 20:40:47 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/hadoop/ant/DfsTask.java     |  9 ++++--
 .../apache/hadoop/ant/condition/DfsExists.java  |  2 +-
 .../apache/hadoop/ant/condition/DfsIsDir.java   |  2 +-
 .../apache/hadoop/ant/condition/DfsZeroLen.java |  2 +-
 .../dev-support/findbugs-exclude.xml            | 29 ++++++++++++++++++++
 hadoop-tools/hadoop-datajoin/pom.xml            | 11 ++++++++
 6 files changed, 50 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/50d06acb/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/DfsTask.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/DfsTask.java b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/DfsTask.java
index 8dc7f37..36119f5 100644
--- a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/DfsTask.java
+++ b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/DfsTask.java
@@ -21,6 +21,7 @@ package org.apache.hadoop.ant;
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.LinkedList;
@@ -146,8 +147,12 @@ public class DfsTask extends Task {
   protected void pushContext() {
     antOut = System.out;
     antErr = System.err;
-    System.setOut(new PrintStream(out));
-    System.setErr(out == err ? System.out : new PrintStream(err));
+    try {
+      System.setOut(new PrintStream(out, false, "UTF-8"));
+      System.setErr(out == err ?
+          System.out : new PrintStream(err, false, "UTF-8"));
+    } catch (UnsupportedEncodingException ignored) {
+    }
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/50d06acb/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsExists.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsExists.java
b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsExists.java
index 8fbe872..95e3868 100644
--- a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsExists.java
+++ b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsExists.java
@@ -19,6 +19,6 @@
 package org.apache.hadoop.ant.condition;
 
 public class DfsExists extends DfsBaseConditional {
-  protected final char flag = 'e';
+  protected static final char flag = 'e';
   protected char getFlag() { return flag; }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/50d06acb/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsIsDir.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsIsDir.java
b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsIsDir.java
index e146d06..b889615 100644
--- a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsIsDir.java
+++ b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsIsDir.java
@@ -19,6 +19,6 @@
 package org.apache.hadoop.ant.condition;
 
 public class DfsIsDir extends DfsBaseConditional {
-  protected final char flag = 'd';
+  protected static final char flag = 'd';
   protected char getFlag() { return flag; }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/50d06acb/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsZeroLen.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsZeroLen.java
b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsZeroLen.java
index caac378..70b4fbf 100644
--- a/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsZeroLen.java
+++ b/hadoop-tools/hadoop-ant/src/main/java/org/apache/hadoop/ant/condition/DfsZeroLen.java
@@ -19,6 +19,6 @@
 package org.apache.hadoop.ant.condition;
 
 public class DfsZeroLen extends DfsBaseConditional {
-  protected final char flag = 'z';
+  protected static final char flag = 'z';
   protected char getFlag() { return flag; }
 }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/50d06acb/hadoop-tools/hadoop-datajoin/dev-support/findbugs-exclude.xml
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-datajoin/dev-support/findbugs-exclude.xml b/hadoop-tools/hadoop-datajoin/dev-support/findbugs-exclude.xml
new file mode 100644
index 0000000..3544581
--- /dev/null
+++ b/hadoop-tools/hadoop-datajoin/dev-support/findbugs-exclude.xml
@@ -0,0 +1,29 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<FindBugsFilter>
+  <!-- These fields are useful for MapReduce jobs, so leave them as-is. -->
+  <Match>
+    <Class name="org.apache.hadoop.contrib.utils.join.DataJoinMapperBase" />
+    <Field name="inputTag" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
+  <Match>
+    <Class name="org.apache.hadoop.contrib.utils.join.DataJoinMapperBase" />
+    <Field name="job" />
+    <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
+  </Match>
+</FindBugsFilter>

http://git-wip-us.apache.org/repos/asf/hadoop/blob/50d06acb/hadoop-tools/hadoop-datajoin/pom.xml
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-datajoin/pom.xml b/hadoop-tools/hadoop-datajoin/pom.xml
index 7e55871..24f8be7 100644
--- a/hadoop-tools/hadoop-datajoin/pom.xml
+++ b/hadoop-tools/hadoop-datajoin/pom.xml
@@ -109,6 +109,17 @@
   <build>
     <plugins>
       <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <configuration>
+          <findbugsXmlOutput>true</findbugsXmlOutput>
+          <xmlOutput>true</xmlOutput>
+          <excludeFilterFile>${basedir}/dev-support/findbugs-exclude.xml
+          </excludeFilterFile>
+          <effort>Max</effort>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message