Emprty name for a type in .avro file creates java class with compile-time
errors.
---------------------------------------------------------------------------------
Key: AVRO-699
URL: https://issues.apache.org/jira/browse/AVRO-699
Project: Avro
Issue Type: Bug
Components: java
Affects Versions: 1.4.1
Environment: Windows 2003 Server
Reporter: prabhakhar kaliyamurthy
Emprty name for a type in .avro file creates java class with compile-time
errors.
Try to generate java object for the following avro defintion.
{
"namespace" : "com.ebay.test.benchmark.avro",
"protocol": "AvroBenchmarkProtocol",
"doc": "BenchmarkingAvro",
"types" : [
{
"type" : "record",
"name" : "AvroBenchmarkObject",
"fields" : [
{"name" : "", "type": "string"}
]
}
]
}
is creating the following java class with compile time error.
package com.ebay.test.benchmark.avro;
@SuppressWarnings("all")
public class AvroBenchmarkObject extends
org.apache.avro.specific.SpecificRecordBase implements
org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ =
org.apache.avro.Schema.parse("{\"type\":\"record\",\"name\":\"AvroBenchmarkObject\",\"namespace\":\"com.ebay.test.benchmark.avro\",\"fields\":[{\"name\":\"\",\"type\":\"int\"}]}");
public int ;
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return ;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: = (java.lang.Integer)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.