You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/04 23:01:20 UTC

[jira] [Commented] (AVRO-1901) creating a record called "Exception" leads to generated code not compiling

    [ https://issues.apache.org/jira/browse/AVRO-1901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15546946#comment-15546946 ] 

ASF GitHub Bot commented on AVRO-1901:
--------------------------------------

GitHub user radai-rosenblatt opened a pull request:

    https://github.com/apache/avro/pull/140

    AVRO-1901: Record named Exception generated bad code

    NOTE - I did not update CHANGES.txt

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/radai-rosenblatt/avro backport-1901-to-1.8

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/avro/pull/140.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #140
    
----
commit 4ae6deb82ce7341f0285559e38111a836f46d430
Author: radai-rosenblatt <ra...@gmail.com>
Date:   2016-09-06T16:16:42Z

    AVRO-1901: Record named Exception generated bad code

----


> 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
>
> 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)