cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/5] git commit: replace FBUtilities.unchecked with Throwables.propagate
Date Fri, 27 Jul 2012 20:47:19 GMT
Updated Branches:
  refs/heads/trunk acedc3438 -> 3d23188a0


replace FBUtilities.unchecked with Throwables.propagate


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

Branch: refs/heads/trunk
Commit: 3d23188a0e7a526992aa3dcb756e75d7d0870fcc
Parents: debb15e
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Jul 27 15:46:49 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Jul 27 15:46:49 2012 -0500

----------------------------------------------------------------------
 .../cassandra/streaming/IncomingStreamReader.java  |    4 ++--
 .../org/apache/cassandra/utils/FBUtilities.java    |    6 +-----
 .../apache/cassandra/utils/WrappedRunnable.java    |    4 +++-
 3 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d23188a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java b/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
index 43d053e..1e5553a 100644
--- a/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
@@ -23,6 +23,7 @@ import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.util.Collections;
 
+import com.google.common.base.Throwables;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,7 +41,6 @@ import org.apache.cassandra.service.StorageService;
 import org.apache.cassandra.streaming.compress.CompressedInputStream;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.BytesReadTracker;
-import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Pair;
 import com.ning.compress.lzf.LZFInputStream;
 
@@ -176,7 +176,7 @@ public class IncomingStreamReader
             if (e instanceof IOException)
                 throw (IOException) e;
             else
-                throw FBUtilities.unchecked(e);
+                throw Throwables.propagate(e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d23188a/src/java/org/apache/cassandra/utils/FBUtilities.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java b/src/java/org/apache/cassandra/utils/FBUtilities.java
index 38bf47b..04a832a 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
 import com.google.common.base.Joiner;
+import com.google.common.base.Throwables;
 import com.google.common.collect.AbstractIterator;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
@@ -597,9 +598,4 @@ public class FBUtilities
                                buffer.getData().length, buffer.getLength(), size, object);
         return buffer.getData();
     }
-
-    public static RuntimeException unchecked(Throwable e)
-    {
-        return e instanceof RuntimeException ? (RuntimeException) e : new RuntimeException(e);
-    }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3d23188a/src/java/org/apache/cassandra/utils/WrappedRunnable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/WrappedRunnable.java b/src/java/org/apache/cassandra/utils/WrappedRunnable.java
index bee0599..1de7a46 100644
--- a/src/java/org/apache/cassandra/utils/WrappedRunnable.java
+++ b/src/java/org/apache/cassandra/utils/WrappedRunnable.java
@@ -17,6 +17,8 @@
  */
 package org.apache.cassandra.utils;
 
+import com.google.common.base.Throwables;
+
 public abstract class WrappedRunnable implements Runnable
 {
     public final void run()
@@ -27,7 +29,7 @@ public abstract class WrappedRunnable implements Runnable
         }
         catch (Exception e)
         {
-            throw FBUtilities.unchecked(e);
+            throw Throwables.propagate(e);
         }
     }
 


Mime
View raw message