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:52:38 GMT
Repository: crunch
Updated Branches:
  refs/heads/master bea44469e -> b4486cc9c


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/b4486cc9
Tree: http://git-wip-us.apache.org/repos/asf/crunch/tree/b4486cc9
Diff: http://git-wip-us.apache.org/repos/asf/crunch/diff/b4486cc9

Branch: refs/heads/master
Commit: b4486cc9c1bdf1d53aebf62c2b28e9ea153d83e1
Parents: bea4446
Author: Josh Wills <jwills@apache.org>
Authored: Thu Jun 5 20:20:26 2014 -0700
Committer: Josh Wills <jwills@apache.org>
Committed: Thu Jun 5 20:20:26 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/b4486cc9/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