[ https://issues.apache.org/jira/browse/THRIFT-2589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14197491#comment-14197491 ]
Hudson commented on THRIFT-2589: -------------------------------- SUCCESS: Integrated in Thrift #1331 (See [https://builds.apache.org/job/Thrift/1331/]) THRIFT-2589 const of BaseType in IDL generates static instead of const properties (jensg: rev c20eeaae8296fa9d9de34b07fe8b21cf509c8884) * compiler/cpp/src/generate/t_csharp_generator.cc > 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)