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

Jens Geyer commented on THRIFT-2589:
------------------------------------

Partially, yes. First, it is in the Repository: 

{code}
SHA-1: c20eeaae8296fa9d9de34b07fe8b21cf509c8884

* THRIFT-2589 const of BaseType in IDL generates static instead of const 
properties
Client: C#
Patch: Thomas Lazar
{code}

{code}
git.exe branch -a --contains c20eeaae8296fa9d9de34b07fe8b21cf509c8884

master
remotes/origin/HEAD -> origin/master
remotes/origin/master

Success (281 ms @ 16.10.2014 21:36:47)
{code}

What you see as the Git 0.9.2 branch was a branch made for the first RC a few 
days earlier, at 2014-07-10 to be precise. The commit above was made on 
2014-08-07, so it is not part of /that/ particular branch. 

But since the 0.9.2 is not yet released, it will become part of the forthcoming 
release, thus the "fixed in version" comment is correct.

> C# generator: const of BaseType in IDL generates static instead of const 
> properties
> -----------------------------------------------------------------------------------
>
>                 Key: THRIFT-2589
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2589
>             Project: Thrift
>          Issue Type: Bug
>          Components: C# - Compiler
>    Affects Versions: 0.9.1
>         Environment: Windows 7
>            Reporter: Thomas Lazar
>            Assignee: Jens Geyer
>             Fix For: 0.9.2
>
>         Attachments: thrift-2589-fix-csharp-basetype-const.patch
>
>
> Compiling a thrift file containing const definitions for basetype variables 
> results in static properties {{public static whatsits}} being generated. 
> Should generate const properties {{public const whatsits}}.
> Current version generates this from test/ConstantsDemo.thrift
> {code}
> public static class ConstantsDemoConstants
> {
>   public static int myInt = 3;
>   public static int hex_const = 31;
>   public static int GEN_ME = -3523553;
>   public static double GEn_DUB = 325.532;
>   public static double GEn_DU = 85.2355;
>   public static string GEN_STRING = "asldkjasfd";
>   public static Dictionary<int, int> GEN_MAP = new Dictionary<int, int>();
>   public static List<int> GEN_LIST = new List<int>();
> ...
> {code}
> The code should instead look like this. 
> {code}
> public static class ConstantsDemoConstants
> {
>   public const int myInt = 3;
>   public const int hex_const = 31;
>   public const int GEN_ME = -3523553;
>   public const double GEn_DUB = 325.532;
>   public const double GEn_DU = 85.2355;
>   public const string GEN_STRING = "asldkjasfd";
>   public static Dictionary<int, int> GEN_MAP = new Dictionary<int, int>();
>   public static List<int> GEN_LIST = new List<int>();
> ...
> {code}
> A patch for this change is supplied. 
> As i don't really know yet how the testing for these kind of changes is done 
> i haven't supplied one. But generating all the .thrift files in test with a 
> before and after version of the compiler and comparing the output of both 
> looked good to me. 



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

Reply via email to