avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AVRO-1148) SpecificData.java has a bug creating a schema for a map
Date Tue, 12 Feb 2013 18:45:12 GMT

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

Doug Cutting updated AVRO-1148:
-------------------------------

       Resolution: Duplicate
    Fix Version/s: 1.7.2
         Assignee:     (was: Ted Malaska)
           Status: Resolved  (was: Patch Available)
    
> SpecificData.java has a bug creating a schema for a map
> -------------------------------------------------------
>
>                 Key: AVRO-1148
>                 URL: https://issues.apache.org/jira/browse/AVRO-1148
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.6.3
>         Environment: Mac
>            Reporter: Amine R.
>              Labels: patch
>             Fix For: 1.7.2
>
>
> in the SepcificData class, the protected Schema createSchema(java.lang.reflect.Type type,
Map<String,Schema> names) fails in creating a schema for the Map type.
> Looking at this excerpt, 
> else if (Map.class.isAssignableFrom(raw)) {   // map
>         java.lang.reflect.Type key = params[0];
>         java.lang.reflect.Type value = params[1];
>         if (!(type instanceof Class
>               && CharSequence.class.isAssignableFrom((Class)type)))
>           throw new AvroTypeException("Map key class not CharSequence: "+key);
>         return Schema.createMap(createSchema(value, names));
>       }
> The type is a map, the key is a string. therefore instead of  "if (!(type instanceof
Class" it should be "if (!(key instanceof Class".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message