crunch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwi...@apache.org
Subject crunch git commit: CRUNCH-530: Fix object-reuse bug in GenericRecordToTuple
Date Sun, 31 May 2015 23:11:16 GMT
Repository: crunch
Updated Branches:
  refs/heads/master 626853abb -> 484545a58


CRUNCH-530: Fix object-reuse bug in GenericRecordToTuple


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

Branch: refs/heads/master
Commit: 484545a583603f9b69ef87c7b1c981d0267b1275
Parents: 626853a
Author: Josh Wills <jwills@apache.org>
Authored: Sun May 31 19:04:19 2015 -0400
Committer: Josh Wills <jwills@apache.org>
Committed: Sun May 31 19:04:19 2015 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/crunch/types/avro/Avros.java        | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/crunch/blob/484545a5/crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java
----------------------------------------------------------------------
diff --git a/crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java b/crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java
index cfdd6b7..0c602d4 100644
--- a/crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java
+++ b/crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java
@@ -491,8 +491,6 @@ public class Avros {
     private final TupleFactory<?> tupleFactory;
     private final List<MapFn> fns;
 
-    private transient Object[] values;
-
     public GenericRecordToTuple(TupleFactory<?> tupleFactory, PType<?>... ptypes)
{
       this.tupleFactory = tupleFactory;
       this.fns = Lists.newArrayList();
@@ -521,12 +519,12 @@ public class Avros {
       for (MapFn fn : fns) {
         fn.initialize();
       }
-      this.values = new Object[fns.size()];
       tupleFactory.initialize();
     }
 
     @Override
     public Tuple map(GenericRecord input) {
+      Object[] values = new Object[fns.size()];
       for (int i = 0; i < values.length; i++) {
         Object v = input.get(i);
         if (v == null) {


Mime
View raw message