avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject avro git commit: AVRO-1695. Fix deepCopy() to get correct logical type conversion.
Date Wed, 31 Aug 2016 23:45:44 GMT
Repository: avro
Updated Branches:
  refs/heads/master be1639c44 -> 9456db018


AVRO-1695. Fix deepCopy() to get correct logical type conversion.


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

Branch: refs/heads/master
Commit: 9456db01859dd3619fb09a6d4205ab433b357b02
Parents: be1639c
Author: Doug Cutting <cutting@apache.org>
Authored: Wed Aug 31 16:45:21 2016 -0700
Committer: Doug Cutting <cutting@apache.org>
Committed: Wed Aug 31 16:45:21 2016 -0700

----------------------------------------------------------------------
 .../avro/src/main/java/org/apache/avro/generic/GenericData.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/9456db01/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
----------------------------------------------------------------------
diff --git a/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java b/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
index 9f3cc4d..76eb625 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java
@@ -1030,7 +1030,7 @@ public class GenericData {
     LogicalType logicalType = schema.getLogicalType();
     if (logicalType == null)           // not a logical type -- use raw copy
       return (T)deepCopyRaw(schema, value);
-    Conversion conversion = getConversionByClass(value.getClass());
+    Conversion conversion = getConversionByClass(value.getClass(), logicalType);
     if (conversion == null)            // no conversion defined -- try raw copy
       return (T)deepCopyRaw(schema, value);
     // logical type with conversion: convert to raw, copy, then convert back to logical


Mime
View raw message