[
https://issues.apache.org/jira/browse/AVRO-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15844010#comment-15844010
]
ASF subversion and git services commented on AVRO-1901:
-------------------------------------------------------
Commit 3345e13238d1d0278a4e1da5a9df60356892193c in avro's branch
refs/heads/branch-1.7 from [~radai]
[ https://git-wip-us.apache.org/repos/asf?p=avro.git;h=3345e13 ]
AVRO-1901: Record named Exception generated bad code
Amending-Author: Ben McCann <[email protected]>
backport to branch-1.7.
Exception record for share/test/schemas/specialtypes.avdl skipped since
branch-1.7 doesn't have AVRO-1614.
Closes #188.
Signed-off-by: Sean Busbey <[email protected]>
> creating a record called "Exception" leads to generated code not compiling
> --------------------------------------------------------------------------
>
> Key: AVRO-1901
> URL: https://issues.apache.org/jira/browse/AVRO-1901
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.7.7, 1.8.1, 1.9.0
> Reporter: radai rosenblatt
> Assignee: Niels Basjes
> Fix For: 1.9.0, 1.8.2
>
>
> consider the following *.avsc file:
> {code:title=Exception.avsc}
> {
> "type": "record",
> "name": "Exception",
> "namespace": "com.acme",
> "fields" : [
> {"name": "value", "type": "int"}
> ],
> "doc": "Will not submit to your fascist naming conventions"
> }
> {code}
> the generated java code will contain:
> {code:title=Exception.java}
> ...
> @override
> public Exception build() {
> try {
> ...
> return record;
> } catch (Exception e) { //boom
> throw new org.apache.avro.AvroRuntimeException(e);
> }
> }
> {code}
> which fails to compile because Exception refers to the generated class (which
> does not extend Throwable)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)