avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Gamache (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1100) ResolveUnion in 1.6.3 thinks a HashMap is a Record.
Date Tue, 22 May 2012 15:21:41 GMT

     [ https://issues.apache.org/jira/browse/AVRO-1100?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Joe Gamache updated AVRO-1100:

    Attachment: ReflectDataTest.java
> ResolveUnion in 1.6.3 thinks a HashMap is a Record.
> ---------------------------------------------------
>                 Key: AVRO-1100
>                 URL: https://issues.apache.org/jira/browse/AVRO-1100
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>         Environment: Windows, eclipse
>            Reporter: Joe Gamache
>         Attachments: IntegerMap.java, ReflectDataTest.java
> Getting an exception thrown on line 542 of ReflectData.java.   Put a breakpoint there
and found the following:
> 1. Datum is a HashMap with 119 entries.
> 2. If I select "getSchemaName(datum)" (line 539) and say inspect, it returns "java.util.HashMap"
> 3. The "indexByName" also being accessed on line 539 = {map=1, null=0}
> 4. In "getSchemaName" if I select "isMap(datum)" and say inspect, it returns "true" (this
would then return "map" which DOES exist in the indexByName structure
> 5. However, still in "getSchemaName" if I select "isRecord(datum)" and say inspect, I
also get back "true".  This then returns "getRecordSchema(datum).getFullName(), which is where
the java.util.HashMap from item #2 comes from.   Since this is not in the "indexByName" map,
I get an UnresolvedUntionException.
> Either "isRecord" needs to be fixed to not return true for Maps, or the test for "isMap"
at line 556 needs to moved up ahead of the test for "isRecord".
> This works fine under 1.5.4, but breaks under 1.6.3.  I have a JUnit test that reproduces
this, if I can figure out how to attach it :), I will.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message