summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorJiayu Liu <jiayu.liu@airbnb.com>2022-02-22 23:17:06 +0800
committerJens Geyer <jensg@apache.org>2022-03-02 22:23:19 +0100
commit5a44db88b200892ff899a74b53d8a482ababb265 (patch)
treecaacde6721a7b1d89674de8a9bb9d42d3096fe5c /compiler
parent4bd1fd80791380de443bb217d7456b7ade56cf8a (diff)
downloadthrift-5a44db88b200892ff899a74b53d8a482ababb265.tar.gz
THRIFT-5525 use "reuse_objects" instead of "reuse-objects" as a consistent param casing
Client: java Patch: Jiayu Liu This closes #2530
Diffstat (limited to 'compiler')
-rw-r--r--compiler/cpp/src/thrift/generate/t_java_generator.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index 23293966b..f43cf5f7b 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -91,7 +91,8 @@ public:
sorted_containers_ = true;
} else if( iter->first.compare("java5") == 0) {
java5_ = true;
- } else if( iter->first.compare("reuse-objects") == 0) {
+ } else if( iter->first.compare("reuse_objects") == 0 || iter->first.compare("reuse-objects") == 0) {
+ // keep both reuse_objects and reuse-objects (legacy) for backwards compatibility
reuse_objects_ = true;
} else if( iter->first.compare("option_type") == 0) {
use_option_type_ = true;
@@ -5453,8 +5454,9 @@ THRIFT_REGISTER_GENERATOR(
" Enable rethrow of unhandled exceptions and let them propagate further."
" (Default behavior is to catch and log it.)\n"
" java5: Generate Java 1.5 compliant code (includes android_legacy flag).\n"
- " reuse-objects: Data objects will not be allocated, but existing instances will be used "
+ " reuse_objects: Data objects will not be allocated, but existing instances will be used "
"(read and write).\n"
+ " reuse-objects: Same as 'reuse_objects' (deprecated).\n"
" sorted_containers:\n"
" Use TreeSet/TreeMap instead of HashSet/HashMap as a implementation of "
"set/map.\n"