You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Ted Malaska (JIRA)" <ji...@apache.org> on 2013/02/12 18:51:12 UTC
[jira] [Updated] (AVRO-1148) SpecificData.java has a bug creating a
schema for a map
[ https://issues.apache.org/jira/browse/AVRO-1148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ted Malaska updated AVRO-1148:
------------------------------
Assignee: Ted Malaska
Status: Patch Available (was: Open)
I did nothing but report that this patch is fixed
> 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.
> Assignee: Ted Malaska
> Labels: patch
>
> 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