You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "Henry Saputra (JIRA)" <ji...@apache.org> on 2014/06/09 07:00:03 UTC

[jira] [Assigned] (GORA-332) Gora 0.4 compiler generate invalid Java code

     [ https://issues.apache.org/jira/browse/GORA-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Saputra reassigned GORA-332:
----------------------------------

    Assignee: Damien Raude-Morvan

> Gora 0.4 compiler generate invalid Java code
> --------------------------------------------
>
>                 Key: GORA-332
>                 URL: https://issues.apache.org/jira/browse/GORA-332
>             Project: Apache Gora
>          Issue Type: Bug
>          Components: gora-compiler
>    Affects Versions: 0.4, 0.5
>            Reporter: Damien Raude-Morvan
>            Assignee: Damien Raude-Morvan
>              Labels: patch
>             Fix For: 0.5
>
>
> Pursuing my journey on GORA-199 I've detected another issue with Gora compiler.if there is a "bytes" type field inside a record.
> {noformat}
> {
>     "name": "RecordWityBytes",
>     "namespace": "com.drazzib.com",
>     "type": "record",
>     "fields": [
>         {
>             "name": "type",
>             "type": {
>                 "name": "MyData",
>                 "type": "bytes"
>             }
>         }
>     ]
> }
> {noformat}
> Gora 0.4 will generate java code without crashing but if you try to compile generated code with javac, you'll get the following error :
> {noformat}
> $> ./bin/gora goracompiler record_with_bytes.avsc test/
> Compiling: /home/drazzib/incoming/apache-gora-0.4/record_with_bytes.avsc
> Compiled into: /home/drazzib/incoming/apache-gora-0.4/test
> Compiler executed SUCCESSFULL.
> $> find test/ -name *.java | xargs javac -cp gora-core/target/classes/:gora-core/lib/avro-1.7.4.jar:gora-core/lib/jackson-core-asl-1.6.9.jar -d test/
> test/com/drazzib/com/RecordWityBytes.java:92: error: cannot find symbol
>     this.type = deepCopyToReadOnlyBuffer(value);
>                 ^
>   symbol:   method deepCopyToReadOnlyBuffer(ByteBuffer)
>   location: class RecordWityBytes
> 1 error
> {noformat}
> You can clone this gist [https://gist.github.com/drazzib/263da2ec0dc46afac0d0] to easily reproduce this issue.



--
This message was sent by Atlassian JIRA
(v6.2#6252)