crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject git commit: CRUNCH-415: Ignore null inputs in AvroByteBufferDeepCopier
Date Mon, 09 Jun 2014 00:56:31 GMT
Repository: crunch
Updated Branches:
  refs/heads/apache-crunch-0.8 a4935cc2a -> a49db45bb


CRUNCH-415: Ignore null inputs in AvroByteBufferDeepCopier


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

Branch: refs/heads/apache-crunch-0.8
Commit: a49db45bbc35ce5fe5d92cf872d7053e780df73f
Parents: a4935cc
Author: Josh Wills <jwills@apache.org>
Authored: Thu Jun 5 20:20:26 2014 -0700
Committer: Josh Wills <jwills@apache.org>
Committed: Sun Jun 8 17:52:55 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/crunch/types/avro/AvroDeepCopier.java    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/a49db45b/crunch-core/src/main/java/org/apache/crunch/types/avro/AvroDeepCopier.java
----------------------------------------------------------------------
diff --git a/crunch-core/src/main/java/org/apache/crunch/types/avro/AvroDeepCopier.java b/crunch-core/src/main/java/org/apache/crunch/types/avro/AvroDeepCopier.java
index 4a98228..855aa79 100644
--- a/crunch-core/src/main/java/org/apache/crunch/types/avro/AvroDeepCopier.java
+++ b/crunch-core/src/main/java/org/apache/crunch/types/avro/AvroDeepCopier.java
@@ -221,6 +221,9 @@ abstract class AvroDeepCopier<T> implements DeepCopier<T>,
Serializable {
 
     @Override
     public ByteBuffer deepCopy(ByteBuffer source) {
+      if (source == null) {
+        return null;
+      }
       byte[] copy = new byte[source.limit()];
       System.arraycopy(source.array(), 0, copy, 0, source.limit());
       return ByteBuffer.wrap(copy);


Mime
View raw message