commit | a1e0a6f0d8c419447fcb95fcb914a9543677bb32 | [log] [tgz] |
---|---|---|
author | David Reiss <dreiss@apache.org> | Tue Jun 10 22:56:43 2008 +0000 |
committer | David Reiss <dreiss@apache.org> | Tue Jun 10 22:56:43 2008 +0000 |
tree | 8ff8439f92769fd68ad2d2956e39f0ad61ef841b | |
parent | 87e9ac638241ca215846bb7643ef8af4ec6fe893 [diff] |
Don't generate a constants file if there are no constants (Java only). git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666372 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc index 6268adf..0c0f287 100644 --- a/compiler/cpp/src/generate/t_java_generator.cc +++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -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());