MikeThomsen commented on code in PR #6013:
URL: https://github.com/apache/nifi/pull/6013#discussion_r869131518


##########
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java:
##########
@@ -712,6 +746,20 @@ public static Object[] toArray(final Object value, final 
String fieldName, final
             return dest;
         }
 
+        if (value instanceof UUID) {
+            UUID uuid = (UUID)value;
+            ByteBuffer buffer = ByteBuffer.allocate(16);
+            buffer.putLong(uuid.getMostSignificantBits());
+            buffer.putLong(uuid.getLeastSignificantBits());
+            Byte[] result = new Byte[16];
+            byte[] array = buffer.array();
+            for (int index = 0; index < array.length; index++) {
+                result[index] = array[index];
+            }
+
+            return result;

Review Comment:
   I noticed that everything, even the "to byte array" conversion goes to the 
boxed byte type, so I followed the convention on the assumption that somewhere 
there might be an expectation of that method not returning a primitive array.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to