cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1082801 - in /cassandra/trunk/src/java/org/apache/cassandra/db/marshal: IntegerType.java LexicalUUIDType.java LongType.java TimeUUIDType.java
Date Fri, 18 Mar 2011 02:37:54 GMT
Author: jbellis
Date: Fri Mar 18 02:37:54 2011
New Revision: 1082801

URL: http://svn.apache.org/viewvc?rev=1082801&view=rev
Log:
use EMPTY_BYTE_BUFFER in AT.fromString
patch by jbellis

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java
    cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java?rev=1082801&r1=1082800&r2=1082801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/IntegerType.java Fri Mar 18 02:37:54
2011
@@ -134,7 +134,7 @@ public final class IntegerType extends A
     {
         // Return an empty ByteBuffer for an empty string.
         if (source.isEmpty())
-            return ByteBuffer.allocate(0);
+            return ByteBufferUtil.EMPTY_BYTE_BUFFER;
         
         BigInteger integerType;
 

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java?rev=1082801&r1=1082800&r2=1082801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LexicalUUIDType.java Fri Mar
18 02:37:54 2011
@@ -24,6 +24,7 @@ package org.apache.cassandra.db.marshal;
 import java.nio.ByteBuffer;
 import java.util.UUID;
 
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.UUIDGen;
 
 public class LexicalUUIDType extends AbstractType<UUID>
@@ -68,8 +69,8 @@ public class LexicalUUIDType extends Abs
     {
         // Return an empty ByteBuffer for an empty string.
         if (source.isEmpty())
-            return ByteBuffer.allocate(0);
-        
+            return ByteBufferUtil.EMPTY_BYTE_BUFFER;
+
         try
         {
             return ByteBuffer.wrap(UUIDGen.decompose(UUID.fromString(source)));

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java?rev=1082801&r1=1082800&r2=1082801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/LongType.java Fri Mar 18 02:37:54
2011
@@ -74,8 +74,8 @@ public class LongType extends AbstractTy
     {
         // Return an empty ByteBuffer for an empty string.
         if (source.isEmpty())
-            return ByteBuffer.allocate(0);
-        
+            return ByteBufferUtil.EMPTY_BYTE_BUFFER;
+
         long longType;
 
         try

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java?rev=1082801&r1=1082800&r2=1082801&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/marshal/TimeUUIDType.java Fri Mar 18
02:37:54 2011
@@ -26,6 +26,7 @@ import java.text.ParseException;
 import java.util.UUID;
 import java.util.regex.Pattern;
 
+import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.UUIDGen;
 import org.apache.commons.lang.time.DateUtils;
@@ -122,7 +123,7 @@ public class TimeUUIDType extends Abstra
     {
         // Return an empty ByteBuffer for an empty string.
         if (source.isEmpty())
-            return ByteBuffer.allocate(0);
+            return ByteBufferUtil.EMPTY_BYTE_BUFFER;
         
         ByteBuffer idBytes = null;
         



Mime
View raw message