You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2008/06/11 00:56:43 UTC

svn commit: r666372 - /incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc

Author: dreiss
Date: Tue Jun 10 15:56:43 2008
New Revision: 666372

URL: http://svn.apache.org/viewvc?rev=666372&view=rev
Log:
Don't generate a constants file if there are no constants (Java only).

Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=666372&r1=666371&r2=666372&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Tue Jun 10 15:56:43 2008
@@ -315,6 +315,10 @@
  * Generates a class that holds all the constants.
  */
 void t_java_generator::generate_consts(std::vector<t_const*> consts) {
+  if (consts.empty()) {
+    return;
+  }
+
   string f_consts_name = package_dir_+"/Constants.java";
   ofstream f_consts;
   f_consts.open(f_consts_name.c_str());