You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jens Geyer (JIRA)" <ji...@apache.org> on 2015/05/12 22:47:00 UTC

[jira] [Assigned] (THRIFT-3089) Assigning default ENUM values results in non-compilable java code if java namespace is not defined

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

Jens Geyer reassigned THRIFT-3089:
----------------------------------

    Assignee: Jens Geyer

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