cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [9/16] git commit: remove unnecessary asserts in native code interfaces patch by jbellis; reviewed by pschuller for CASSANDRA-4096
Date Fri, 30 Mar 2012 16:24:54 GMT
remove unnecessary asserts in native code interfaces
patch by jbellis; reviewed by pschuller for CASSANDRA-4096


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

Branch: refs/heads/cassandra-1.1
Commit: 4a6531172c7d142e199f198e275942b7952c80f7
Parents: 5cde93d
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Mar 30 10:41:32 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Mar 30 10:41:32 2012 -0500

----------------------------------------------------------------------
 CHANGES.txt                                       |    1 +
 src/java/org/apache/cassandra/utils/CLibrary.java |    8 +++-----
 2 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4a653117/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index bf1a34f..e81f2bb 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@
  * allow custom types in CLI's assume command (CASSANDRA-4081)
  * fix totalBytes count for parallel compactions (CASSANDRA-3758)
  * fix intermittent NPE in get_slice (CASSANDRA-4095)
+ * remove unnecessary asserts in native code interfaces (CASSANDRA-4096)
 
 
 1.0.8

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4a653117/src/java/org/apache/cassandra/utils/CLibrary.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/CLibrary.java b/src/java/org/apache/cassandra/utils/CLibrary.java
index 090a355..6270d8c 100644
--- a/src/java/org/apache/cassandra/utils/CLibrary.java
+++ b/src/java/org/apache/cassandra/utils/CLibrary.java
@@ -105,8 +105,7 @@ public final class CLibrary
     {
         try
         {
-            int result = mlockall(MCL_CURRENT);
-            assert result == 0; // mlockall should always be zero on success
+            mlockall(MCL_CURRENT);
             logger.info("JNA mlockall successful");
         }
         catch (UnsatisfiedLinkError e)
@@ -143,8 +142,7 @@ public final class CLibrary
     {
         try
         {
-            int result = link(sourceFile.getAbsolutePath(), destinationFile.getAbsolutePath());
-            assert result == 0; // success is always zero
+            link(sourceFile.getAbsolutePath(), destinationFile.getAbsolutePath());
         }
         catch (UnsatisfiedLinkError e)
         {
@@ -242,12 +240,12 @@ public final class CLibrary
 
     public static int tryFcntl(int fd, int command, int flags)
     {
+        // fcntl return value may or may not be useful, depending on the command
         int result = -1;
 
         try
         {
             result = CLibrary.fcntl(fd, command, flags);
-            assert result >= 0; // on error a value of -1 is returned and errno is set
to indicate the error.
         }
         catch (RuntimeException e)
         {


Mime
View raw message