update according to review comments

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

Branch: refs/heads/master
Commit: a7d0289ca52f2a9f2d84ce1bf9ebc84d3c7dcd87
Parents: c4dfa33
Author: basti.lj <[email protected]>
Authored: Thu Feb 4 19:47:35 2016 +0800
Committer: basti.lj <[email protected]>
Committed: Thu Feb 4 19:47:35 2016 +0800

----------------------------------------------------------------------
 .../jvm/org/apache/storm/daemon/AckerBolt.java  |  4 +--
 .../src/jvm/org/apache/storm/utils/Utils.java   | 32 +++-----------------
 2 files changed, 6 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/a7d0289c/storm-core/src/jvm/org/apache/storm/daemon/AckerBolt.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/daemon/AckerBolt.java 
b/storm-core/src/jvm/org/apache/storm/daemon/AckerBolt.java
index a4f6815..763b9a0 100644
--- a/storm-core/src/jvm/org/apache/storm/daemon/AckerBolt.java
+++ b/storm-core/src/jvm/org/apache/storm/daemon/AckerBolt.java
@@ -107,12 +107,12 @@ public class AckerBolt implements IBolt {
         if (task != null) {
             if (curr.val == 0) {
                 pending.remove(id);
-                List values = Utils.mkList(id);
+                List values = Utils.makeList(id);
                 collector.emitDirect(task, ACKER_ACK_STREAM_ID, values);
             } else {
                 if (curr.failed) {
                     pending.remove(id);
-                    List values = Utils.mkList(id);
+                    List values = Utils.makeList(id);
                     collector.emitDirect(task, ACKER_FAIL_STREAM_ID, values);
                 }
             }

http://git-wip-us.apache.org/repos/asf/storm/blob/a7d0289c/storm-core/src/jvm/org/apache/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/utils/Utils.java 
b/storm-core/src/jvm/org/apache/storm/utils/Utils.java
index e3813f8..9ca2ece 100644
--- a/storm-core/src/jvm/org/apache/storm/utils/Utils.java
+++ b/storm-core/src/jvm/org/apache/storm/utils/Utils.java
@@ -1375,35 +1375,11 @@ public class Utils {
         }
     }
 
-    public static <T> long bitXorValsSets(java.util.Set<T> vals) {
-        long rtn = 0l;
-        for (T n : vals) {
-            rtn = bitXor(rtn, n);
-        }
-        return rtn;
-    }
-
     public static long bitXor(Object a, Object b) {
-        long rtn;
-
-        if (a instanceof Long && b instanceof Long) {
-            rtn = ((Long) a) ^ ((Long) b);
-            return rtn;
-        } else if (b instanceof Set) {
-            long bs = bitXorValsSets((Set) b);
-            return bitXor(a, bs);
-        } else if (a instanceof Set) {
-            long as = bitXorValsSets((Set) a);
-            return bitXor(as, b);
-        } else {
-            long ai = Long.parseLong(String.valueOf(a));
-            long bi = Long.parseLong(String.valueOf(b));
-            rtn = ai ^ bi;
-            return rtn;
-        }
+        return  ((Long) a) ^ ((Long) b);
     }
 
-    public static <V> List<V> mkList(V... args) {
+    public static <V> List<V> makeList(V... args) {
         ArrayList<V> rtn = new ArrayList<V>();
         for (V o : args) {
             rtn.add(o);
@@ -1411,7 +1387,7 @@ public class Utils {
         return rtn;
     }
 
-    public static <V> List<V> mkList(java.util.Set<V> args) {
+    public static <V> List<V> makeList(java.util.Set<V> args) {
         ArrayList<V> rtn = new ArrayList<V>();
         if (args != null) {
             for (V o : args) {
@@ -1421,7 +1397,7 @@ public class Utils {
         return rtn;
     }
 
-    public static <V> List<V> mkList(Collection<V> args) {
+    public static <V> List<V> makeList(Collection<V> args) {
         ArrayList<V> rtn = new ArrayList<V>();
         if (args != null) {
             for (V o : args) {

Reply via email to