This is an automated email from the ASF dual-hosted git repository.

maedhroz pushed a commit to branch cep-15-accord
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit cdc52fac53511d5bcb8a3a8cffe6e109d3ce6bf5
Author: David Capwell <dcapw...@apache.org>
AuthorDate: Mon Dec 12 15:52:20 2022 -0800

    Ninja for CASSANDRA-17719: When a reference sees a null, return 
Constants.NULL_VALUE rather than try to parse it
---
 .../org/apache/cassandra/service/accord/txn/TxnReferenceOperation.java  | 2 ++
 src/java/org/apache/cassandra/service/accord/txn/TxnReferenceValue.java | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperation.java 
b/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperation.java
index 9ab0194e96..695b920d91 100644
--- 
a/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperation.java
+++ 
b/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceOperation.java
@@ -238,6 +238,8 @@ public class TxnReferenceOperation
     private Term toTerm(TxnData data, AbstractType<?> receivingType, 
ProtocolVersion version)
     {
         ByteBuffer bytes = value.compute(data, receivingType);
+        if (bytes == null)
+            return Constants.NULL_VALUE;
         return toTerm(bytes, receivingType, version);
     }
 
diff --git 
a/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceValue.java 
b/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceValue.java
index 1041968458..fb4a54f8d5 100644
--- a/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceValue.java
+++ b/src/java/org/apache/cassandra/service/accord/txn/TxnReferenceValue.java
@@ -89,7 +89,7 @@ public abstract class TxnReferenceValue
         @Override
         public String toString()
         {
-            return ByteBufferUtil.bytesToHex(value);
+            return "Constant=" + ByteBufferUtil.bytesToHex(value);
         }
 
         @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to