You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@crunch.apache.org by jw...@apache.org on 2014/06/09 02:52:38 UTC
git commit: CRUNCH-415: Ignore null inputs in AvroByteBufferDeepCopier
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 <jw...@apache.org>
Authored: Thu Jun 5 20:20:26 2014 -0700
Committer: Josh Wills <jw...@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);