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

ASF GitHub Bot commented on THRIFT-3089:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/thrift/pull/490


> Assigning default ENUM values results in non-compilable java code if java 
> namespace is not defined
> --------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3089
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3089
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.9.2
>            Reporter: Pavan Chitumalla
>            Assignee: Jens Geyer
>
> {code:title=enumtest.thrift}
> enum Color {
>   BLACK = 5,
>   WHITE = 6
> }
> struct Params {
>   1: optional Color bColor = Color.BLACK;
> }
> {code}
> Running thrift --gen java enumtest.thrift (thrift 0.9.2 on OSX 10.10.3)
> results in non-compilable java code.
> {code}
>   public Params() {
>     this.bColor = .Color.BLACK;
>   }
>   @Override
>   public void clear() {
>     this.bColor = .Color.BLACK;
>   }
> {code}
> Notice the "." before Color.BLACK. If java namespace is defined in the thrift 
> file, it works as expected.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to