Return-Path: X-Original-To: apmail-avro-dev-archive@www.apache.org Delivered-To: apmail-avro-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F0DA8D4C6 for ; Fri, 7 Sep 2012 20:14:07 +0000 (UTC) Received: (qmail 38714 invoked by uid 500); 7 Sep 2012 20:14:07 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 38639 invoked by uid 500); 7 Sep 2012 20:14:07 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 38626 invoked by uid 99); 7 Sep 2012 20:14:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Sep 2012 20:14:07 +0000 Date: Sat, 8 Sep 2012 07:14:07 +1100 (NCT) From: "Amine R. (JIRA)" To: dev@avro.apache.org Message-ID: <1984558239.52022.1347048847697.JavaMail.jiratomcat@arcas> Subject: [jira] [Created] (AVRO-1148) SpecificData.java has a bug creating a schema for a map MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Amine R. created AVRO-1148: ------------------------------ Summary: 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. in the SepcificData class, the protected Schema createSchema(java.lang.reflect.Type type, Map 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