Thrift-1090: Document the generation of a file called "Constants.java"
authorJake Farrell <jfarrell@apache.org>
Tue, 6 Dec 2011 00:48:04 +0000 (00:48 +0000)
committerJake Farrell <jfarrell@apache.org>
Tue, 6 Dec 2011 00:48:04 +0000 (00:48 +0000)
Client: java
Patch: Mike Riley

Adds program_name to the Constants file in java to match all other client libs.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1210724 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_java_generator.cc

index fa87d09..49f81be 100644 (file)
@@ -483,7 +483,7 @@ void t_java_generator::generate_consts(std::vector<t_const*> consts) {
     return;
   }
 
-  string f_consts_name = package_dir_+"/Constants.java";
+  string f_consts_name = package_dir_+ '/' + program_name_ + "Constants.java";
   ofstream f_consts;
   f_consts.open(f_consts_name.c_str());
 
@@ -494,7 +494,7 @@ void t_java_generator::generate_consts(std::vector<t_const*> consts) {
     java_type_imports();
 
   f_consts <<
-    "public class Constants {" << endl <<
+    "public class " << program_name_ << "Constants {" << endl <<
     endl;
   indent_up();
   vector<t_const*>::iterator c_iter;